Package snap.web
Class ParsedURL
java.lang.Object
snap.web.ParsedURL
A class to parse a URL string and provide the parts.
Has the form: [Scheme:][//Authority][/Path[!/Path]][?Query][#HashTag].
Authority has the form: [UserInfo@]Host[:Port].
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Standard equals implementation.Returns the last component of the file path.Returns the filename without extension.Returns the URL string for the file only (no query/hashtags).Returns the hashtag reference from the URL as a simple string.getHashtagValue
(String aKey) Returns the value for given hashtag key in URL, if available.getPath()
Returns the part of the string that describes the file path.int
getPort()
Returns the port of the URL.getQuery()
Returns the part of the URL string that describes the query.Returns the URL string for the file and query only (no hashtag references).getQueryValue
(String aKey) Returns the value for given Query key in URL, if available.Returns the URL Scheme (lower case).Returns the site id string.Returns the site string.Returns the URL string.getUser()
Returns the User part of the URL.Returns the windows drive letter path.int
hashCode()
Standard HashCode implementation.boolean
Returns whether URL specifies only the file (no query/hashtags).boolean
Returns whether URL specifies only file and query (no hashtag references).protected void
parseString
(String aStr) Sets the string and it's pieces.toString()
Standard toString implementation.
-
Constructor Details
-
ParsedURL
Constructor for given string.
-
-
Method Details
-
getString
Returns the URL string. -
parseString
Sets the string and it's pieces. -
getScheme
Returns the URL Scheme (lower case). -
getSiteId
Returns the site id string. -
getSiteUrl
Returns the site string. -
getUser
Returns the User part of the URL. -
getPort
public int getPort()Returns the port of the URL. -
getPath
Returns the part of the string that describes the file path. -
getFilename
Returns the last component of the file path. -
getFilenameSimple
Returns the filename without extension. -
getQuery
Returns the part of the URL string that describes the query. -
getQueryValue
Returns the value for given Query key in URL, if available. -
getHashtag
Returns the hashtag reference from the URL as a simple string. -
getHashtagValue
Returns the value for given hashtag key in URL, if available. -
isFileURL
public boolean isFileURL()Returns whether URL specifies only the file (no query/hashtags). -
getFileURL
Returns the URL string for the file only (no query/hashtags). -
isQueryURL
public boolean isQueryURL()Returns whether URL specifies only file and query (no hashtag references). -
getQueryURL
Returns the URL string for the file and query only (no hashtag references). -
getWindowsDriveLetterPath
Returns the windows drive letter path. -
equals
Standard equals implementation. -
hashCode
public int hashCode()Standard HashCode implementation. -
toString
Standard toString implementation.
-