|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ws4d.java.types.URI
public class URI
This class implements the Uniform Resource Identifier RFC3986. All constructors which use strings a representation of URIs or paths expects encoded strings, if any not allowed characters - specified by the RFC3986 - must be part of this Strings.
Field Summary | |
---|---|
static URI |
EMPTY_URI
|
static java.lang.String |
URN_SCHEMA_PREFIX
|
Constructor Summary | |
---|---|
URI(java.lang.String uri)
Constructor. |
|
URI(java.lang.String baseURI,
java.lang.String path)
Creates an URI from a base URI as String and a path as
String which is regarded to be relative to the given base
URI. |
|
URI(java.lang.String absoluteURI,
URI baseURI)
Creates an URI from String . |
|
URI(URI baseURI,
java.lang.String path)
Creates an URI from a base URI and a path as which is regarded to be relative to the given base URI. |
|
URI(URI baseURI,
URI uri)
Constructor. |
Method Summary | |
---|---|
static URI |
absolutize(URI baseUri,
java.lang.String newUri)
TODO |
java.lang.Object |
clone()
Creates a clone of this URI. |
boolean |
equals(java.lang.Object obj)
|
boolean |
equalsWsdRfc3986(URI other)
Case-insensitive comparison of this with the given uri. |
java.lang.String |
getFragment()
Returns the fragment defined in the URI. e.g. the fragment behind the "#". |
java.lang.String |
getHost()
Returns the host defined in the URI. |
java.lang.String |
getHostWithPort()
Returns a String containing the host and the port defined in
the URI. e.g. host:port. |
java.lang.String |
getPassword()
Returns the password defined in the URI. |
java.lang.String |
getPath()
Returns the path defined in the URI. |
java.lang.String |
getPath(int deepness)
Returns the leading part of the path, calculated by the path deepness. |
int |
getPathDeepness()
Returns the deepness of the path inside this URI. |
int |
getPort()
Returns the port for the host part of this URI. |
java.lang.String |
getQuery()
Returns the query defined in the URI. e.g. the part behind the "?". |
java.lang.String |
getSchema()
Returns the schema defined in the URI. |
java.lang.String |
getUser()
Returns the user defined in the URI. |
int |
hashCode()
|
boolean |
isIPv6Address()
|
static boolean |
isIPv6Address(java.lang.String address)
Check for IPv6 address. |
boolean |
isRelativeReference()
Returns true if this is a relative URI, false
if the base part is set. |
boolean |
isURN()
Returns true if this URI has the URN schema,
false otherwise. |
boolean |
isValid()
Returns true , if the URI seams to be correct and there were
no problems while parsing it. |
void |
setFragment(java.lang.String fragment)
|
void |
setFragmentEncoded(java.lang.String encodedFragment)
|
void |
setQuery(java.lang.String query)
|
void |
setQueryEncoded(java.lang.String encodedQuery)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String URN_SCHEMA_PREFIX
public static final URI EMPTY_URI
Constructor Detail |
---|
public URI(java.lang.String uri)
String
.
uri
- The String representation of an URI. If the URI string must
contain any not allowed characters, specified by the RFC3986,
this characters have to be percent encoded.public URI(URI baseURI, URI uri)
baseURI
- Base URI, must be a non relative URI, fragment will be
ignored.uri
- public URI(URI baseURI, java.lang.String path)
This method allows to change the path of the URI. For instance: http://example.org/testing into http://example.org/stable
baseURI
- URI to be the base of the newly created URI.path
- A path relative to the baseURI. If the path string must
contain any not allowed characters, specified by the RFC3986,
this characters have to be percent encoded.public URI(java.lang.String absoluteURI, URI baseURI)
String
.
absoluteURI
- the String representation of an URI.baseURI
- if baseURI is set the absoluteURI is handled as relative
URI in relation to the baseURI.public URI(java.lang.String baseURI, java.lang.String path)
String
and a path as
String
which is regarded to be relative to the given base
URI.
baseURI
- the String representation of an absolute base URIpath
- A path relative to the baseURI. No path with reserved
characters allowed, those characters must be encoded.Method Detail |
---|
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.Object clone()
clone
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public boolean equalsWsdRfc3986(URI other)
other
-
true
only if this URI instance equals
other
in terms of RFC3986 equalitypublic boolean isRelativeReference()
true
if this is a relative URI, false
if the base part is set.
true
if this is a relative URI, false
if the base part is set.public boolean isValid()
true
, if the URI seams to be correct and there were
no problems while parsing it.
true
, if the URI could be parsed, false
otherwise.public boolean isURN()
true
if this URI has the URN schema,
false
otherwise.
true
if this URI has the URN schema,
false
otherwise.public java.lang.String getSchema()
public java.lang.String getUser()
public java.lang.String getPassword()
public java.lang.String getHost()
public int getPort()
public java.lang.String getHostWithPort()
String
containing the host and the port defined in
the URI. e.g. host:port.
public java.lang.String getPath()
public java.lang.String getQuery()
public void setQuery(java.lang.String query)
public void setQueryEncoded(java.lang.String encodedQuery)
public java.lang.String getFragment()
public void setFragment(java.lang.String fragment)
public void setFragmentEncoded(java.lang.String encodedFragment)
public int getPathDeepness()
public java.lang.String getPath(int deepness)
uri
- The URI to use.deepness
- The path deepness.
public static URI absolutize(URI baseUri, java.lang.String newUri)
baseUri
- newUri
-
baseUri
and
newUri
public static final boolean isIPv6Address(java.lang.String address)
This will check the string for textual representation of an IPv6 address. At first, this method will check for the colon which should be between the hex digits.
address
- the string representation of the address which should be
checked.
true
if the string is a IPv6 address,
false
otherwise.public boolean isIPv6Address()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |