java.lang.Object
org.seppiko.commons.utils.http.URIUtil
URI Util
[scheme ":"] ["//" authority] "/" path ["?" query] ["#" fragment]
authority = [userinfo "@"] host [":" port]
userinfo = username [":" password]
But the URI definition requires that the scheme must be used.- Author:
- Leonard Woo
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetFileExtension(String filename) get file extensionstatic StringgetLastPathname(String uri) Get last path name (e.g.static URIget URI object
-
Constructor Details
-
URIUtil
public URIUtil()
-
-
Method Details
-
getUri
get URI object- Parameters:
uri- URI address (like url)- Returns:
- URI object
- Throws:
NullPointerException- If uri string is nullIllegalArgumentException- If the given string violates RFC 2396
-
getLastPathname
public static String getLastPathname(String uri) throws IllegalArgumentException, NullPointerException Get last path name (e.g. filename)- Parameters:
uri- URI- Returns:
- last path content e.g. filename
- Throws:
IllegalArgumentException- uri is not legal URINullPointerException- uri is null
-
getFileExtension
get file extension- Parameters:
filename- file name (e.g. last pathname)- Returns:
- file extension, if not found return null
- Throws:
NullPointerException- filename is null
-