public class Uri extends java.lang.Object implements java.lang.Comparable<Uri>
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
authority
Authority components decoded, if present.
|
protected java.lang.String |
authorityRaw
Raw authority components, if present.
|
protected boolean |
bAbsolute
Boolean indicating whether this URI is absolute.
|
protected boolean |
bOpaque
Boolean indicating whether this URI is opaque, @see #isOpaque()
|
protected java.lang.String |
fragment
Fragment component decoded, if present.
|
protected java.lang.String |
fragmentRaw
Raw fragment component, if present.
|
protected java.lang.String |
hierPartRaw
Raw hier-part part ("//" + authority + path).
|
protected java.lang.String |
host
Host authority component decoded, if present.
|
protected java.lang.String |
hostRaw
Host authority component, if present.
|
protected java.lang.String |
path
Path component decoded.
|
protected java.lang.String |
pathRaw
Raw path component.
|
protected int |
port
Port authority component, if present.
|
protected java.lang.String |
portRaw
Raw port authority component, if present.
|
protected java.lang.String |
query
Query component decoded, if present.
|
protected java.lang.String |
queryRaw
Raw query component, if present.
|
protected java.lang.String |
scheme
Scheme component, if present.
|
protected java.lang.String |
schemeSpecificPart
Scheme specific part decoded.
|
protected java.lang.String |
schemeSpecificPartRaw
Raw scheme specific part, if present.
|
protected UriProfile |
uriProfile
Profile used to parse URI.
|
protected java.lang.String |
userinfo
Userinfo authority component decoded, if present.
|
protected java.lang.String |
userinfoRaw
Raw userinfo authority component, if present.
|
| Modifier | Constructor and Description |
|---|---|
protected |
Uri()
Constructor for unit-testing.
|
|
Uri(java.lang.String str)
Constructs a URI by parsing the given string using the default RFC3986
profile.
|
|
Uri(java.lang.String str,
UriProfile uriProfile)
Constructs a URI by parsing the given string using the requested
profile.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Uri uri) |
static Uri |
create(java.lang.String str)
Creates a URI by parsing the given string using the default RFC3986
profile.
|
static Uri |
create(java.lang.String str,
UriProfile uriProfile)
Creates a URI by parsing the given string using the requested profile.
|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getAuthority()
Returns the decoded authority component of this URI.
|
java.lang.String |
getFragment()
Returns the decoded fragment component of this URI.
|
java.lang.String |
getHost()
Returns the host component of this URI.
|
java.lang.String |
getPath()
Returns the decoded path component of this URI.
|
int |
getPort()
Returns the port number of this URI.
|
java.lang.String |
getQuery()
Returns the decoded query component of this URI.
|
java.lang.String |
getRawAuthority()
Returns the raw authority component of this URI.
|
java.lang.String |
getRawFragment()
Returns the raw fragment component of this URI.
|
java.lang.String |
getRawPath()
Returns the raw path component of this URI.
|
java.lang.String |
getRawQuery()
Returns the raw query component of this URI.
|
java.lang.String |
getRawSchemeSpecificPart()
Returns the raw scheme-specific part of this URI.
|
java.lang.String |
getRawUserInfo()
Returns the raw user-information component of this URI.
|
java.lang.String |
getScheme()
Returns the scheme component of this URI.
|
java.lang.String |
getSchemeSpecificPart()
Returns the decoded scheme-specific part of this URI.
|
java.lang.String |
getUserInfo()
Returns the decoded user-information component of this URI.
|
int |
hashCode() |
boolean |
isAbsolute()
Tells whether or not this URI is absolute.
|
boolean |
isOpaque()
Tells whether or not this URI is opaque.
|
java.lang.String |
toString() |
protected void |
validate_absoluteUri(java.lang.String uriStr,
int uIdx)
Parse and validate an absolute URI string.
|
protected void |
validate_relativeUri(java.lang.String uriStr,
int uIdx)
Parse and validate a relative URI string.
|
protected java.lang.String hierPartRaw
protected java.lang.String schemeSpecificPartRaw
protected java.lang.String authorityRaw
protected java.lang.String userinfoRaw
protected java.lang.String hostRaw
protected java.lang.String portRaw
protected java.lang.String pathRaw
protected java.lang.String queryRaw
protected java.lang.String fragmentRaw
protected java.lang.String scheme
protected java.lang.String schemeSpecificPart
protected java.lang.String authority
protected java.lang.String userinfo
protected java.lang.String host
protected int port
protected java.lang.String path
protected java.lang.String query
protected java.lang.String fragment
protected boolean bAbsolute
protected boolean bOpaque
protected UriProfile uriProfile
protected Uri()
public Uri(java.lang.String str) throws java.net.URISyntaxException
str - The string to be parsed into a URIjava.net.URISyntaxException - If the given string violates RFC 3986public Uri(java.lang.String str, UriProfile uriProfile) throws java.net.URISyntaxException
str - The string to be parsed into a URIuriProfile - the requested profilejava.net.URISyntaxException - If the given string violates the profilepublic static Uri create(java.lang.String str) throws java.lang.IllegalArgumentException
str - The string to be parsed into a URIjava.lang.IllegalArgumentException - If the given string violates RFC 3986public static Uri create(java.lang.String str, UriProfile uriProfile) throws java.lang.IllegalArgumentException
str - The string to be parsed into a URIuriProfile - the requested profilejava.lang.IllegalArgumentException - If the given string violates the profileprotected void validate_absoluteUri(java.lang.String uriStr, int uIdx) throws java.net.URISyntaxException
uriStr - URI stringuIdx - index in string after scheme colon characterjava.net.URISyntaxException - if the URI is invalid in some wayprotected void validate_relativeUri(java.lang.String uriStr, int uIdx) throws java.net.URISyntaxException
uriStr - URI stringuIdx - index in string to start parsing fromjava.net.URISyntaxException - if the URI is invalid in some waypublic boolean isAbsolute()
public boolean isOpaque()
public java.lang.String getScheme()
public java.lang.String getRawSchemeSpecificPart()
public java.lang.String getSchemeSpecificPart()
public java.lang.String getRawAuthority()
public java.lang.String getAuthority()
public java.lang.String getRawUserInfo()
public java.lang.String getUserInfo()
public java.lang.String getHost()
public int getPort()
public java.lang.String getRawPath()
public java.lang.String getPath()
public java.lang.String getRawQuery()
public java.lang.String getQuery()
public java.lang.String getRawFragment()
public java.lang.String getFragment()
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.ObjectCopyright © 2011–2023. All rights reserved.