|
| Uri (final Encoded uri) throws URISyntaxException |
| Creates a new Uri instance according to the given encoded string uri . More...
|
|
final boolean | isFileScheme () |
| Returns true, if this instance is a file scheme , otherwise false. More...
|
|
final boolean | isJarScheme () |
| Returns true, if this instance is a jar scheme , otherwise false. More...
|
|
final Encoded | getEncoded () |
| Returns the encoded input , never null . More...
|
|
final String | toString () |
| Returns the encoded input as String, never null , same as getEncoded() . More...
|
|
ASCIIEncoded | toASCIIString () |
| Returns the encoded input encoded in US-ASCII. More...
|
|
final java.net.URI | toURI () |
| Returns a new URI instance using the encoded input string, new URI(uri.input) , i.e. More...
|
|
final java.net.URI | toURIReencoded () throws URISyntaxException |
| Returns a new URI instance based upon this instance. More...
|
|
final java.net.URL | toURL () throws MalformedURLException |
| Returns a new URL instance using the encoded input string, new URL(uri.input) , i.e. More...
|
|
final File | toFile () |
| If this instance is a file scheme , implementation decodes [ "//"+authority ] + path ,
then it processes the result if File#separatorChar == '\' as follows: More...
|
|
final String | getUriFilePathOrASCII () |
| If this uri is a file scheme implementation returns toFile() . More...
|
|
final Uri | getContainedUri () throws URISyntaxException |
| If this instance's schemeSpecificPart contains a Uri itself, a sub-Uri, return schemeSpecificPart + # fragment via it's own new Uri instance. More...
|
|
final Uri | getNormalized () |
| Normalizes this Uri's path and return the normalized form if it differs, otherwise this instance. More...
|
|
Uri | getDirectory () |
| Returns this Uri's directory Uri. More...
|
|
final Uri | getParent () |
| Returns this Uri's parent directory Uri. More...
|
|
Uri | getRelativeOf (final Encoded appendPath) throws URISyntaxException |
| Returns a new Uri appending the given appendPath to this instance's directory . More...
|
|
final Uri | concat (final Encoded suffix) throws URISyntaxException |
| Concatenates the given encoded string to the encoded uri of this instance and returns a new Uri instance with the result. More...
|
|
final Uri | getNewQuery (final Encoded newQuery) throws URISyntaxException |
| Returns a new Uri instance w/ the given new query newQuery . More...
|
|
final boolean | equals (final Object o) |
|
final int | hashCode () |
|
|
static String | encode (final String vanilla, final String legal) |
| All characters are encoded into their hexadecimal value prepended by '', except: More...
|
|
static String | encodeToASCIIString (final String unicode) |
| Other characters, which are Unicode chars that are not US-ASCII, and are not ISO Control or are not ISO Space chars are not preserved and encoded into their hexidecimal value prepended by ''. More...
|
|
static String | decode (final Encoded encoded) |
| Safe Encoded#decode() call on optional encoded instance. More...
|
|
static String | decode (final String encoded) |
| Decodes the string argument which is assumed to be encoded in the
x-www-form-urlencoded MIME content type using the UTF-8 encoding scheme. More...
|
|
static Uri | create (final String scheme, final String ssp, final String fragment) throws URISyntaxException |
| Creates a new Uri instance using the given unencoded arguments. More...
|
|
static Uri | create (final Encoded scheme, final Encoded ssp, final Encoded fragment) throws URISyntaxException |
| Creates a new Uri instance using the given encoded arguments. More...
|
|
static Uri | create (final String scheme, final String userinfo, String host, final int port, final String path, final String query, final String fragment) throws URISyntaxException |
| Creates a new Uri instance using the given unencoded arguments. More...
|
|
static Uri | create (final Encoded scheme, final Encoded userinfo, final Encoded host, final int port, final Encoded path, final Encoded query, final Encoded fragment) throws URISyntaxException |
| Creates a new Uri instance using the given encoded arguments. More...
|
|
static Uri | create (final String scheme, final String host, final String path, final String fragment) throws URISyntaxException |
| Creates a new Uri instance using the given unencoded arguments. More...
|
|
static Uri | create (final Encoded scheme, final Encoded host, final Encoded path, final Encoded fragment) throws URISyntaxException |
| Creates a new Uri instance using the given encoded arguments. More...
|
|
static Uri | create (final String scheme, final String authority, final String path, final String query, final String fragment) throws URISyntaxException |
| Creates a new Uri instance using the given unencoded arguments. More...
|
|
static Uri | create (final Encoded scheme, final Encoded authority, final Encoded path, final Encoded query, final Encoded fragment) throws URISyntaxException |
| Creates a new Uri instance using the given encoded arguments. More...
|
|
static Uri | cast (final String encodedUri) throws URISyntaxException |
| Casts the given encoded String to a new Encoded instance used to create the resulting Uri instance via Uri(Encoded) . More...
|
|
static Uri | valueOfFilepath (final String path) throws URISyntaxException |
| Creates a new Uri instance using the given file-path argument. More...
|
|
static Uri | valueOf (final File file) throws URISyntaxException |
| Creates a new Uri instance using the given File instance. More...
|
|
static Uri | valueOf (final java.net.URI uri) throws URISyntaxException |
| Creates a new Uri instance using the given URI instance. More...
|
|
static Uri | valueOf (final java.net.URL url) throws URISyntaxException |
| Creates a new Uri instance using the given URL instance, convenient wrapper for valueOf(URI) and URL#toURI() . More...
|
|
|
final Encoded | input |
| Encoded input string used at construction, never null . More...
|
|
final Encoded | scheme |
| Encoded scheme , null if undefined. More...
|
|
final Encoded | schemeSpecificPart |
| Encoded scheme-specific-part , never null . More...
|
|
final Encoded | path |
| Encoded path part of scheme-specific-part , never null . More...
|
|
final boolean | hasAuthority |
| Indicating whether authority part is defined or not. More...
|
|
final Encoded | authority |
| Encoded authority part of scheme-specific-part , null if undefined. More...
|
|
final Encoded | userInfo |
| Encoded userinfo part of authority and scheme-specific-part , null if undefined. More...
|
|
final Encoded | host |
| Encoded host part of authority and scheme-specific-part , null if undefined. More...
|
|
final int | port |
| Encoded port part of authority and scheme-specific-part , -1 if undefined. More...
|
|
final Encoded | query |
| Encoded query part of scheme-specific-part , null if undefined. More...
|
|
final Encoded | fragment |
| Encoded fragment , null if undefined. More...
|
|
final boolean | absolute |
| Indicating whether this Uri is absolute, i.e. More...
|
|
final boolean | opaque |
| Indicating whether this Uri is opaque, i.e. More...
|
|
This class implements an immutable Uri as defined by RFC 2396.
Character encoding is employed as defined by RFC 3986, see RFC 3986 section 2.1, while multibyte unicode characters are preserved in encoded parts.
1 [scheme:]scheme-specific-part[fragment]
2 [scheme:][//authority]path[?query][fragment]
3 [scheme:][//[user-info@]host[:port]]path[?query][fragment]
scheme-specific-part: [//authority]path[?query]
authority: [user-info@]host[:port]
<p<blockquote>
RFC 3986 section 2.2 Reserved Characters (January 2005)
! | * | ' | ( | ) | ; | : | </code> | &
| =
| +
| $
| ,
| /
| ?
| #
| [
| ]
|
RFC 3986 section 2.3 Unreserved Characters (January 2005)
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z |
a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | t | u | v | w | x | y | z |
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | - | _ | . | ~ |
Other characters in a Uri must be percent encoded.
- Since
- 0.3.0
Definition at line 162 of file Uri.java.
Creates a new Uri instance using the given encoded arguments.
This constructor first creates a temporary Uri string from the given encoded encoded components. This string will be parsed later on to create the Uri instance.
The given encoded components are taken as-is, i.e. no re-encoding will be performed! However, Uri parsing will re-evaluate encoding of the resulting components.
[scheme:][//authority][path][?query][#fragment]
host
and port
may be undefined or invalid, in the optional authority
.
- Parameters
-
scheme | the encoded scheme part of the Uri. |
authority | the encoded authority part of the Uri. |
path | the encoded path to the resource on the host. |
query | the encoded query part of the Uri to specify parameters for the resource. |
fragment | the encoded fragment part of the Uri. |
- Exceptions
-
URISyntaxException | if the temporary created string doesn't fit to the specification RFC2396 or could not be parsed correctly. |
Definition at line 1032 of file Uri.java.
Creates a new Uri instance using the given encoded arguments.
This constructor first creates a temporary Uri string from the given encoded components. This string will be parsed later on to create the Uri instance.
The given encoded components are taken as-is, i.e. no re-encoding will be performed! However, Uri parsing will re-evaluate encoding of the resulting components.
[scheme:]host[path][#fragment]
host
must be valid, if defined.
- Parameters
-
scheme | the encoded scheme part of the Uri. |
host | the encoded host name of the Uri. |
path | the encoded path to the resource on the host. |
fragment | the encoded fragment part of the Uri. |
- Exceptions
-
URISyntaxException | if the temporary created string doesn't fit to the specification RFC2396 or could not be parsed correctly. |
Definition at line 941 of file Uri.java.
static Uri org.jau.net.Uri.create |
( |
final Encoded |
scheme, |
|
|
final Encoded |
ssp, |
|
|
final Encoded |
fragment |
|
) |
| throws URISyntaxException |
|
static |
Creates a new Uri instance using the given encoded arguments.
This constructor first creates a temporary Uri string from the given encoded components. This string will be parsed later on to create the Uri instance.
The given encoded components are taken as-is, i.e. no re-encoding will be performed! However, Uri parsing will re-evaluate encoding of the resulting components.
[scheme:]scheme-specific-part[#fragment]
host
and port
may be undefined or invalid within scheme-specific-part
.
- Parameters
-
scheme | the encoded scheme part of the Uri. |
ssp | the encoded scheme-specific-part of the Uri. |
fragment | the encoded fragment part of the Uri. |
- Exceptions
-
URISyntaxException | if the temporary created string doesn't fit to the specification RFC2396 or could not be parsed correctly. |
Definition at line 706 of file Uri.java.
Creates a new Uri instance using the given encoded arguments.
This constructor first creates a temporary Uri string from the given encoded components. This string will be parsed later on to create the Uri instance.
The given encoded components are taken as-is, i.e. no re-encoding will be performed! However, Uri parsing will re-evaluate encoding of the resulting components.
[scheme:][user-info@]host[:port][path][?query][#fragment]
host
and port
must be defined and valid, if any authority
components are defined, i.e. user-info
, host
or port
.
- Parameters
-
scheme | the encoded scheme part of the Uri. |
userinfo | the encoded user information of the Uri for authentication and authorization, null for undefined. |
host | the encoded host name of the Uri, null for undefined. |
port | the port number of the Uri, -1 for undefined. |
path | the encoded path to the resource on the host. |
query | the encoded query part of the Uri to specify parameters for the resource. |
fragment | the encoded fragment part of the Uri. |
- Exceptions
-
URISyntaxException | if the temporary created string doesn't fit to the specification RFC2396 or could not be parsed correctly. |
Definition at line 840 of file Uri.java.
static Uri org.jau.net.Uri.create |
( |
final String |
scheme, |
|
|
final String |
authority, |
|
|
final String |
path, |
|
|
final String |
query, |
|
|
final String |
fragment |
|
) |
| throws URISyntaxException |
|
static |
Creates a new Uri instance using the given unencoded arguments.
This constructor first creates a temporary Uri string from the given unencoded components. This string will be parsed later on to create the Uri instance.
[scheme:][//authority][path][?query][#fragment]
host
and port
may be undefined or invalid, in the optional authority
.
- Parameters
-
scheme | the unencoded scheme part of the Uri. |
authority | the unencoded authority part of the Uri. |
path | the unencoded path to the resource on the host. |
query | the unencoded query part of the Uri to specify parameters for the resource. |
fragment | the unencoded fragment part of the Uri. |
- Exceptions
-
URISyntaxException | if the temporary created string doesn't fit to the specification RFC2396 or could not be parsed correctly. |
Definition at line 968 of file Uri.java.
static Uri org.jau.net.Uri.create |
( |
final String |
scheme, |
|
|
final String |
host, |
|
|
final String |
path, |
|
|
final String |
fragment |
|
) |
| throws URISyntaxException |
|
static |
Creates a new Uri instance using the given unencoded arguments.
This constructor first creates a temporary Uri string from the given unencoded components. This string will be parsed later on to create the Uri instance.
[scheme:]host[path][#fragment]
host
must be valid, if defined.
- Parameters
-
scheme | the unencoded scheme part of the Uri. |
host | the unencoded host name of the Uri. |
path | the unencoded path to the resource on the host. |
fragment | the unencoded fragment part of the Uri. |
- Exceptions
-
URISyntaxException | if the temporary created string doesn't fit to the specification RFC2396 or could not be parsed correctly. |
Definition at line 912 of file Uri.java.
static Uri org.jau.net.Uri.create |
( |
final String |
scheme, |
|
|
final String |
ssp, |
|
|
final String |
fragment |
|
) |
| throws URISyntaxException |
|
static |
Creates a new Uri instance using the given unencoded arguments.
This constructor first creates a temporary Uri string from the given unencoded components. This string will be parsed later on to create the Uri instance.
[scheme:]scheme-specific-part[#fragment]
host
and port
may be undefined or invalid within scheme-specific-part
.
- Parameters
-
scheme | the unencoded scheme part of the Uri. |
ssp | the unencoded scheme-specific-part of the Uri. |
fragment | the unencoded fragment part of the Uri. |
- Exceptions
-
URISyntaxException | if the temporary created string doesn't fit to the specification RFC2396 or could not be parsed correctly. |
Definition at line 661 of file Uri.java.
static Uri org.jau.net.Uri.create |
( |
final String |
scheme, |
|
|
final String |
userinfo, |
|
|
String |
host, |
|
|
final int |
port, |
|
|
final String |
path, |
|
|
final String |
query, |
|
|
final String |
fragment |
|
) |
| throws URISyntaxException |
|
static |
Creates a new Uri instance using the given unencoded arguments.
This constructor first creates a temporary Uri string from the given unencoded components. This string will be parsed later on to create the Uri instance.
[scheme:][user-info@]host[:port][path][?query][#fragment]
host
and port
must be defined and valid, if any authority
components are defined, i.e. user-info
, host
or port
.
- Parameters
-
scheme | the unencoded scheme part of the Uri. |
userinfo | the unencoded user information of the Uri for authentication and authorization, null for undefined. |
host | the unencoded host name of the Uri, null for undefined. |
port | the port number of the Uri, -1 for undefined. |
path | the unencoded path to the resource on the host. |
query | the unencoded query part of the Uri to specify parameters for the resource. |
fragment | the unencoded fragment part of the Uri. |
- Exceptions
-
URISyntaxException | if the temporary created string doesn't fit to the specification RFC2396 or could not be parsed correctly. |
Definition at line 750 of file Uri.java.
static String org.jau.net.Uri.decode |
( |
final String |
encoded | ) |
|
|
static |
Decodes the string argument which is assumed to be encoded in the
x-www-form-urlencoded
MIME content type using the UTF-8 encoding scheme.
'' and two following hex digit characters are converted to the equivalent byte value. All other characters are passed through unmodified.
e.g. "A%20B%20C %24%25" -> "A B C $%"
- Parameters
-
encoded | The encoded string. |
- Returns
- java.lang.String The decoded version.
Definition at line 596 of file Uri.java.
static String org.jau.net.Uri.encode |
( |
final String |
vanilla, |
|
|
final String |
legal |
|
) |
| |
|
static |
All characters are encoded into their hexadecimal value prepended by '', except:
-
letters ('a'..'z', 'A'..'Z')
-
numbers ('0'..'9')
-
characters in the legal-set parameter
-
others (unicode characters that are not in US-ASCII set, and are not ISO Control or are not ISO Space characters)
Use encodeToASCIIString(String)
for US-ASCII encoding.
Consider using Encoded#Encoded(String, String)
in APIs to distinguish encoded from unencoded data by type.
- Parameters
-
vanilla | the string to be encoded |
legal | extended character set, allowed to be preserved in the vanilla string |
- Returns
- java.lang.String the converted string
Definition at line 524 of file Uri.java.
static String org.jau.net.Uri.encodeToASCIIString |
( |
final String |
unicode | ) |
|
|
static |
Other characters, which are Unicode chars that are not US-ASCII, and are not ISO Control or are not ISO Space chars are not preserved and encoded into their hexidecimal value prepended by ''.
For example: Euro currency symbol -> "%E2%82%AC".
Consider using ASCIIEncoded#ASCIIEncoded(String)
in APIs to distinguish encoded from unencoded data by type.
- Parameters
-
unicode | string to be converted |
- Returns
- java.lang.String the converted string
Definition at line 559 of file Uri.java.
final Uri org.jau.net.Uri.getContainedUri |
( |
| ) |
throws URISyntaxException |
If this instance's schemeSpecificPart
contains a Uri itself, a sub-Uri, return schemeSpecificPart
+ #
fragment
via it's own new Uri instance.
In case this Uri is a jar-scheme
, the query
is omitted, since 0.3.0
Otherwise method returns null
.
Example 1:
This instance: jar:scheme2:/some/path/gluegen-rt.jar!/com/jogamp/common/GlueGenVersion.class
Returned Uri: scheme2:/some/path/gluegen-rt.jar
Example 2:
This instance: jar:scheme2:/some/path/gluegen-rt.jar!/com/jogamp/common/GlueGenVersion.class?lala=01fragment
Returned Uri: scheme2:/some/path/gluegen-rt.jar::fragment
Example 3:
This instance: scheme1:scheme2:/some/path/gluegen-rt.jar!/?lala=01fragment
Returned Uri: scheme2:/some/path/gluegen-rt.jar?lala=01fragment
- Exceptions
-
URISyntaxException | if this Uri is a container Uri and does not comply with the container spec, i.e. a JAR Uri |
Definition at line 1414 of file Uri.java.
final boolean org.jau.net.Uri.opaque |
Indicating whether this Uri is opaque, i.e.
non-hierarchical scheme-specific-part
.
An opaque Uri has no scheme-specific-part
being parsed, i.e. path
, query
and authority
are null
.
Definition at line 1225 of file Uri.java.