Package com.inductiveautomation.snap.web
Class WebURL
java.lang.Object
com.inductiveautomation.snap.web.WebURL
A class to represent a URL for a WebSite and WebFile (it can be both for nested sources).
 Has the form: [Scheme:][//Authority][/Path[!/Path]][?Query][#HashTag].
 Authority has the form: [UserInfo@]Host[:Port].
 
 WebURL is a thin wrapper around standard URL, but provides easy access to the WebSite and WebFile.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptioncreateFile(boolean isDir) Creates a file for the URL.booleanStandard equals implementation.getFile()Returns the file for the URL, may be null.protected WebFileReturns the URL for the file (no hashtags).getHost()Returns the Host part of the URL (the Authority minus the optional UserInfo and Port).getPath()Returns the part of the URL string that describes the file path.Returns the last component of the file path.intgetPort()Returns the port of the URL.getQuery()Returns the part of the URL string that describes the query.getQueryValue(String aKey) Returns the value for given Query key in URL, if available.getRef()Returns the hash tag reference from the URL as a simple string.getRefValue(String aKey) Returns the value for given HashTag key in URL, if available.Returns the URL Scheme (lower case).getSite()Returns the URL for the source of this URL.getURL()Returns the standard URL.static WebURLReturns a URL for given class and resource name.static WebURLReturns a URL for given object.inthashCode()Standard HashCode implementation.booleanReturns whether file has been set/loaded for this URL.booleanReturns whether URL is for file only (no hashtags).booleanReturns whether URL is for static file only (no query/hashtags).toString()Standard toString implementation.
- 
Constructor Details- 
WebURLCreates a new WebURL for given URL string.
 
- 
- 
Method Details- 
getURLReturns a URL for given object.- Parameters:
- anObj- Object to create a WebURL from. May be null (if null, null is returned.)
- Returns:
- a WebURL if one could be created, otherwise null.
 
- 
getURLReturns a URL for given class and resource name.
- 
getURLReturns the standard URL.
- 
getString- Returns:
- Returns the URL string, not null
 
- 
getSchemeReturns the URL Scheme (lower case).
- 
getHostReturns the Host part of the URL (the Authority minus the optional UserInfo and Port).
- 
getPortpublic int getPort()Returns the port of the URL.
- 
getPathReturns the part of the URL string that describes the file path.
- 
getPathNameReturns the last component of the file path. Not null.
- 
getPathNameSimple- Returns:
- Returns the last component of the file path minus any '.' extension suffix, not null
 
- 
getQueryReturns the part of the URL string that describes the query.
- 
getQueryValueReturns the value for given Query key in URL, if available.
- 
getRefReturns the hash tag reference from the URL as a simple string.
- 
getRefValueReturns the value for given HashTag key in URL, if available.
- 
getSite- Returns:
- Returns the source of this URL, not null.
 
- 
getSiteURLReturns the URL for the source of this URL.
- 
isFileSetpublic boolean isFileSet()Returns whether file has been set/loaded for this URL.
- 
getFileReturns the file for the URL, may be null.
- 
getFileImpl- Returns:
- Returns the file for the URL, may be null.
 
- 
createFileCreates a file for the URL.
- 
isFileURLpublic boolean isFileURL()Returns whether URL is for file only (no hashtags).
- 
isStaticFileURLpublic boolean isStaticFileURL()Returns whether URL is for static file only (no query/hashtags).
- 
getFileURLReturns the URL for the file (no hashtags).
- 
getStaticFileURL- Returns:
- Returns the URL for the static file (no query/hashtags), not null.
 
- 
getAsSite- Returns:
- Returns the site for the URL, not null
 
- 
equalsStandard equals implementation.
- 
hashCodepublic int hashCode()Standard HashCode implementation.
- 
toStringStandard toString implementation. Not null.
 
-