Package com.iizix.urn.url
Class URL_URN
- java.lang.Object
- com.iizix.urn.URN
- com.iizix.urn.url.URL_URN
 
 
- All Implemented Interfaces:
- java.io.Serializable,- java.lang.Cloneable
 - public class URL_URN extends URN implements java.lang.Cloneable, java.io.Serializable URL Uniform Resource Naming (URN) instance class, holding the URL.- IIZI URL URN's are formatted as: - urn:iz-url:utf8encodedPath[?+query][#fragment]- where the - url:utf8encodedPathis the file resource path encoded in UTF-8, followed by an optional- queryand an optional- fragment.- The IIZI URL URN's will then represent the following URL: - webServerHost[?query][#fragment]- where - webServerHostwill be the external web server unsecure protocol- http://or secure- https://followed by the external host name or IP address of the web server. In case of clustering and/or usage of redundant servers, the name may be an alias that will direct the actual HTTP[S] request to the correct party in question.- Author:
- Christopher Mindus
- See Also:
- Serialized Form
 
- Method Summary- All Methods Static Methods Instance Methods Concrete Methods - Modifier and Type - Method - Description - boolean- equals(java.lang.Object obj)Checks if two instances are equal.- static URL_URN- fromURL(java.lang.String url)Creates a URL URN from a string containing an optional '?' query and '#' fragment.- static URL_URN- fromURL(java.lang.String url, java.lang.String query, java.lang.String fragment)Creates a URL URN from a string and an optional query and fragment.- static URL_URN- fromURL(java.net.URL url)Creates a URL URN from a string and an optional query and fragment.- java.lang.String- getParamString()Gets the parameter string for the- URN.toString()method.- java.lang.String- getURL()Gets the URL of this resource relative the current web server.- int- hashCode()Hash code of this instance.- Methods inherited from class com.iizix.urn.URN- asURNResource, from, getImageTarget, getURNString, isImageTargetSupported, isURNResource, toString
 
 
- Method Detail- fromURL- public static URL_URN fromURL(java.lang.String url) throws java.net.MalformedURLException, MalformedURNException Creates a URL URN from a string containing an optional '?' query and '#' fragment.- Parameters:
- url- The URL string.
- Throws:
- java.lang.NullPointerException- If the- urlis null.
- java.net.MalformedURLException- If the- urlis malformed.
- MalformedURNException- If the- urlis malformed for an iizi URN URL.
 
 - fromURL- public static URL_URN fromURL(java.lang.String url, java.lang.String query, java.lang.String fragment) throws java.net.MalformedURLException, MalformedURNException Creates a URL URN from a string and an optional query and fragment.- Parameters:
- url- The URL base string without query and fragment.
- query- The query string, or- nullfor none. The query, if defined, will be appended to the URL prefixed by '?'. No encoding will be done, so it is important that the query is correctly encoded, e.g. parameters specified as abc=enc(data)&def=enc(data) where "enc(data)" URI-encodes the specific data using UTF-8 character set.
- fragment- The fragment part,- nullfor none. The fragment will not be encoded, but if present, appended to the url with '#' before.
- Throws:
- java.lang.NullPointerException- If the- urlis null.
- java.net.MalformedURLException- If the- urlis malformed.
- MalformedURNException- If the- urlis malformed for an iizi URN URL.
 
 - fromURL- public static URL_URN fromURL(java.net.URL url) throws MalformedURNException Creates a URL URN from a string and an optional query and fragment.- Parameters:
- url- The URL.
- Throws:
- java.lang.NullPointerException- If the- urlis null.
- MalformedURNException- If the- urlis malformed for an iizi URN URL.
 
 - getURL- public java.lang.String getURL() Gets the URL of this resource relative the current web server.
 - getParamString- public java.lang.String getParamString() Gets the parameter string for the- URN.toString()method.- Specified by:
- getParamStringin class- URN
- Returns:
- The parameter string, always non-null.
 
 - hashCode- public int hashCode() Hash code of this instance.