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]
RFC 3986 section 2.2 Reserved Characters (January 2005)
! |
* |
' |
( |
) |
; |
: |
@ |
& |
= |
+ |
$ |
, |
/ |
? |
# |
[ |
] |
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.
| Modifier and Type | Class and Description |
|---|---|
| public static class | |
| public static class | Uri.
Immutable RFC3986 encoded string. |
| Modifier and Type | Field and Description |
|---|---|
| public final boolean | absolute
Indicating whether this Uri is absolute, i.e. has a |
| public final Uri. | authority
Encoded |
| public static final String | AUTHORITY_LEGAL
Valid charset for RFC 2396 |
| private static final boolean | |
| private static final boolean | |
| private static final String | |
| private static final String | |
| public static final String | |
| public static final String | FRAG_LEGAL
Valid charset for RFC 2396 |
| public final Uri. | fragment
Encoded |
| public static final char | |
| public final boolean | hasAuthority
Indicating whether |
| private int | |
| public final Uri. | host
Encoded |
| public static final String | |
| public static final String | |
| public final Uri. | input
Encoded input string used at construction, never |
| private Uri. | inputASCII
Encoded input string used at construction, in US-ASCII encoding. |
| public static final String | |
| public static final char | JAR_SCHEME_SEPARATOR
A JAR sub-protocol is separated from the JAR entry w/ this separator . |
| private final Object | |
| private static final String | |
| public final boolean | opaque
Indicating whether this Uri is opaque, i.e. non-hierarchical |
| private static final int | PARSE_HINT_FIX_PATH
Usually used to fix a path from a previously contained and opaque Uri,
i.e. |
| public final Uri. | path
Encoded |
| public static final String | PATH_LEGAL
Valid charset for RFC 2396 |
| private static final Pattern | |
| public final int | port
Encoded |
| private static final String | |
| public final Uri. | query
Encoded |
| public static final String | QUERY_LEGAL
Valid charset for RFC 2396 |
| public static final char | |
| public static final String | |
| public static final String | |
| public final Uri. | scheme
Encoded |
| public static final char | |
| public final Uri. | schemeSpecificPart
Encoded |
| public static final String | SSP_LEGAL
Valid charset for RFC 2396 |
| public static final String | |
| public final Uri. | userInfo
Encoded |
| public static final String | USERINFO_LEGAL
Valid charset for RFC 2396 |
| Access | Constructor and Description |
|---|---|
| public | |
| private |
| Modifier and Type | Method and Description |
|---|---|
| private static void | |
| public static Uri | cast(final String encodedUri)
Casts the given encoded String to a |
| public final Uri | concat(final Uri.
Concatenates the given encoded string to the |
| private String | |
| public static Uri | |
| public static Uri | |
| public static Uri | create(final String
the unencoded scheme part of the Uri. scheme, final String the unencoded user information of the Uri for authentication and authorization, userinfo, String null for undefined.the unencoded host name of the Uri, host, final int null for undefined.the port number of the Uri, -1 for undefined. port, final String the unencoded path to the resource on the host. path, final String the unencoded query part of the Uri to specify parameters for the resource. query, final String the unencoded fragment part of the Uri. fragment)Creates a new Uri instance using the given unencoded arguments. |
| public static Uri | create(final Uri.
the encoded scheme part of the Uri. scheme,the encoded user information of the Uri for authentication and authorization, userinfo,null for undefined.the encoded host name of the Uri, host,null for undefined.the port number of the Uri, -1 for undefined. port, final Uri.the encoded path to the resource on the host. path,the encoded query part of the Uri to specify parameters for the resource. query,the encoded fragment part of the Uri. fragmentCreates a new Uri instance using the given encoded arguments. |
| public static Uri | create(final String
the unencoded scheme part of the Uri. scheme, final String the unencoded host name of the Uri. host, final String the unencoded path to the resource on the host. path, final String the unencoded fragment part of the Uri. fragment)Creates a new Uri instance using the given unencoded arguments. |
| public static Uri | create(final Uri.
the encoded scheme part of the Uri. scheme,the encoded host name of the Uri. host,the encoded path to the resource on the host. path,the encoded fragment part of the Uri. fragmentCreates a new Uri instance using the given encoded arguments. |
| public static Uri | create(final String
the unencoded scheme part of the Uri. scheme, final String the unencoded authority part of the Uri. authority, final String the unencoded path to the resource on the host. path, final String the unencoded query part of the Uri to specify parameters for the resource. query, final String the unencoded fragment part of the Uri. fragment)Creates a new Uri instance using the given unencoded arguments. |
| public static Uri | create(final Uri.
the encoded scheme part of the Uri. scheme,the encoded authority part of the Uri. authority,the encoded path to the resource on the host. path,the encoded query part of the Uri to specify parameters for the resource. query,the encoded fragment part of the Uri. fragmentCreates a new Uri instance using the given encoded arguments. |
| private static final boolean | cutoffLastPathSegementImpl(final StringBuilder pathBuf, final boolean cutoffFile, final boolean cutoffDir, final Uri.
|
| private final Uri | cutoffLastPathSegementImpl(final boolean cutoffFile, final boolean cutoffDir, final Uri.
|
| public static String | |
| public static String | |
| private static boolean | |
| private static boolean | |
| public static String | Returns: java.lang.String the converted stringthe string to be encoded vanilla, final String extended character set, allowed to be preserved in the vanilla string legal)All characters are encoded into their hexadecimal value prepended by '%', except:
|
| private static void | |
| public static String | Returns: java.lang.String the converted stringstring to be converted 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 '%'. |
| public final boolean | Returns: true if both Uri instances point to the same resource,
false otherwise.the Uri this instance has to be compared with. o)Overrides java. |
| private boolean | |
| private static void | |
| private static void | |
| public final Uri | getContainedUri()
If this instance's |
| public Uri | |
| public final Uri. | |
| private String | |
| public final Uri | |
| public final Uri | getNormalized()
|
| public final Uri | |
| public Uri | getRelativeOf(final Uri.
denotes a relative path to be appended to this Uri's directory appendPathReturns a new Uri appending the given |
| public final int | |
| public final boolean | |
| public final boolean | |
| private static boolean | |
| private static boolean | |
| private boolean | isValidHost(final boolean expectServer, final Uri.
distinguish between IPv4, IPv6, domain name and validate it based on its type |
| private static boolean | |
| private static boolean | |
| private static boolean | |
| public Uri. | |
| public final File | toFile()
If this instance
|
| public final String | toString()
Overrides java. input as String, never null, same as getEncoded().
|
| public final URI | |
| public final URI | |
| public final URL | |
| private static int | |
| private static void | |
| private static int | validateEncoded(final String
java.lang.String the string to be validatedjava.lang.String the characters allowed in the String
sValidate a string by checking if it contains any characters other than:
|
| private static void | |
| private static void | |
| private static void | |
| private static void | |
| private static void | |
| private static void | |
| public static Uri | |
| public static Uri | |
| public static Uri | valueOf(final URL
A given URL instance url)Creates a new Uri instance using the given URL instance,
convenient wrapper for |
| public static Uri | valueOfFilepath(final String
the unencoded path of the path)file schema.Creates a new Uri instance using the given file-path argument. |