public final class UriComponent extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
FRAGMENT
Fragment.
|
static int |
HOST
Host URI component.
|
static int |
PATH
Path URI components, consists of path-segments.
|
static int |
PATH_SEGMENT
Path segment URI sub-component, it can't contains '/'.
|
static String |
PERCENT
Encoded '%' character.
|
static int |
PORT
Port URI component.
|
static int |
QUERY
Query string.
|
static int |
SCHEME
Scheme URI component.
|
static int |
SSP
Scheme-specific part.
|
static int |
USER_INFO
UserInfo URI component.
|
| Modifier and Type | Method and Description |
|---|---|
static boolean |
checkHexCharacters(String s,
int p)
Check does two next characters after '%' represent percent-encoded
character.
|
static String |
decode(String str,
int component)
Decode percent encoded URI string.
|
static String |
encode(String str,
int component,
boolean containsUriParams)
Encode given URI string.
|
static URI |
normalize(URI uri)
Normalization URI according to rfc3986.
|
static List<javax.ws.rs.core.PathSegment> |
parsePathSegments(String path,
boolean decode)
Parse path segments.
|
static javax.ws.rs.core.MultivaluedMap<String,String> |
parseQueryString(String rawQuery,
boolean decode)
Parse encoded query string.
|
static UriBuilderImpl |
parseTemplate(String template) |
static String |
recognizeEncode(String str,
int component,
boolean containsUriParams)
Check string and if it does not contains any '%' characters validate it
for contains only valid characters.
|
static String |
validate(String str,
int component,
boolean containsUriParams)
Validate content of percent-encoding string.
|
public static final int SCHEME
public static final int USER_INFO
public static final int HOST
public static final int PORT
public static final int PATH_SEGMENT
public static final int PATH
public static final int QUERY
public static final int FRAGMENT
public static final int SSP
public static final String PERCENT
public static URI normalize(URI uri)
uri - source URIpublic static String encode(String str, int component, boolean containsUriParams)
str - the URI stringcontainsUriParams - true if the source string contains URI parameterscomponent - component of URI, scheme, host, port, etcpublic static String validate(String str, int component, boolean containsUriParams)
str - the string which must be validatecomponent - component of URI, scheme, host, port, etccontainsUriParams - true if the source string contains URI parameterspublic static String recognizeEncode(String str, int component, boolean containsUriParams)
str - source stringcomponent - part of URI, e. g. schema, host, pathcontainsUriParams - does string may contains URI templatespublic static String decode(String str, int component)
str - the source percent encoded stringcomponent - component of URI, scheme, host, port, etc. NOTE type of
component is not used currently but will be used for decoding IPv6
addressespublic static boolean checkHexCharacters(String s, int p)
s - source stringp - position of character in stringpublic static List<javax.ws.rs.core.PathSegment> parsePathSegments(String path, boolean decode)
path - the relative pathdecode - true if character must be decoded false otherwisePathSegmentpublic static javax.ws.rs.core.MultivaluedMap<String,String> parseQueryString(String rawQuery, boolean decode)
rawQuery - source query stringdecode - if true then query parameters will be decodedMultivaluedMap with query parameterspublic static UriBuilderImpl parseTemplate(String template)
Copyright © 2012–2016 Codenvy, S.A.. All rights reserved.