Class URLParser
java.lang.Object
org.deltava.util.URLParser
A utility class to parse URLs.
- Since:
- 1.0
- Version:
- 10.3
- Author:
- Luke
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
containsPath
(String path) Returns if the URL contains a particular path entry.Returns the file extension.Returns the file name and extension.Returns the first directory element.Returns the last directory element.getName()
Returns the file name, minus extension.getPath()
Returns the path entries.int
size()
Returns the number of elements in the URL.
-
Constructor Details
-
URLParser
Initializes the object and parses the URL.- Parameters:
rawURL
- the URL to parse
-
-
Method Details
-
getExtension
-
getFileName
-
getName
-
getPath
-
getFirstPath
Returns the first directory element.- Returns:
- the first element , or an empty string if not present
-
getLastPath
Returns the last directory element.- Returns:
- the last element before the file name, or an empty string if not present
-
containsPath
Returns if the URL contains a particular path entry.- Parameters:
path
- the path entry to search for- Returns:
- TRUE if the URL contains the path, otherwise FALSE
-
size
public int size()Returns the number of elements in the URL.- Returns:
- the number of elements
-