public class URIUtil extends Object implements Cloneable
UTF-8 encoding is used by default for % encoded characters. This may be overridden with the org.eclipse.jetty.util.URI.charset system property.
UrlEncoded
Modifier and Type | Field and Description |
---|---|
static Charset |
__CHARSET |
static String |
HTTP |
static String |
HTTP_COLON |
static String |
HTTPS |
static String |
HTTPS_COLON |
static String |
SLASH |
Modifier and Type | Method and Description |
---|---|
static String |
addPaths(String p1,
String p2)
Add two URI path segments.
|
static void |
appendSchemeHostPort(StringBuffer url,
String scheme,
String server,
int port)
Append scheme, host and port URI prefix, handling IPv6 address encoding and default ports
|
static void |
appendSchemeHostPort(StringBuilder url,
String scheme,
String server,
int port)
Append scheme, host and port URI prefix, handling IPv6 address encoding and default ports
|
static String |
canonicalPath(String path)
Convert a path to a cananonical form.
|
static String |
compactPath(String path)
Convert a path to a compact form.
|
static String |
decodePath(byte[] buf,
int offset,
int length) |
static String |
decodePath(String path) |
static String |
encodePath(String path)
Encode a URI path.
|
static StringBuilder |
encodePath(StringBuilder buf,
String path)
Encode a URI path.
|
static StringBuilder |
encodeString(StringBuilder buf,
String path,
String encode)
Encode a URI path.
|
static boolean |
equalsIgnoreEncodings(String uriA,
String uriB) |
static boolean |
hasScheme(String uri) |
static String |
newURI(String scheme,
String server,
int port,
String path,
String query)
Create a new URI from the arguments, handling IPv6 host encoding and default ports
|
static StringBuilder |
newURIBuilder(String scheme,
String server,
int port)
Create a new URI StringBuilder from the arguments, handling IPv6 host encoding and default ports
|
static String |
parentPath(String p)
Return the parent Path.
|
public static final String SLASH
public static final String HTTP
public static final String HTTP_COLON
public static final String HTTPS
public static final String HTTPS_COLON
public static final Charset __CHARSET
public static String encodePath(String path)
path
- The path the encodepublic static StringBuilder encodePath(StringBuilder buf, String path)
path
- The path the encodebuf
- StringBuilder to encode path into (or null)public static StringBuilder encodeString(StringBuilder buf, String path, String encode)
path
- The path the encodebuf
- StringBuilder to encode path into (or null)encode
- String of characters to encode. % is always encoded.public static String decodePath(byte[] buf, int offset, int length)
public static String addPaths(String p1, String p2)
p1
- URI path segment (should be encoded)p2
- URI path segment (should be encoded)public static String parentPath(String p)
public static String canonicalPath(String path)
path
- public static String compactPath(String path)
path
- public static boolean hasScheme(String uri)
uri
- URIpublic static String newURI(String scheme, String server, int port, String path, String query)
scheme
- server
- port
- path
- query
- public static StringBuilder newURIBuilder(String scheme, String server, int port)
scheme
- server
- port
- public static void appendSchemeHostPort(StringBuilder url, String scheme, String server, int port)
url
- StringBuilder to append toscheme
- server
- port
- public static void appendSchemeHostPort(StringBuffer url, String scheme, String server, int port)
url
- StringBuffer to append toscheme
- server
- port
- Copyright © 1995-2015 Webtide. All Rights Reserved.