public class URIUtil extends Object
Constructor and Description |
---|
URIUtil() |
Modifier and Type | Method and Description |
---|---|
static URI |
absolutize(URI pAbsoluteURI,
URI pRelativeURI)
This method will try to make an absolute version of the provided
relative URI by resolving it against the provided absolute
URI.
|
static String |
decode(String pEncoded) |
static String |
encode(String pEncoded)
This method will encode characters which are invalid for use in
URI.
|
static String |
encodePathSegment(String pPathSegment)
This method will encode a URI path segment.
|
public static String encodePathSegment(String pPathSegment)
encode
, also the characters /, =,
; and ? are encoded as they should appear in a
path segment.pPathSegement
- The URI path segment to encodepublic static String encode(String pEncoded)
pEncoded
- The string to encodepublic static URI absolutize(URI pAbsoluteURI, URI pRelativeURI)
If the relative URI starts with a /, then the match has to be against the start of path of the absolute URI.
Examples:
absolute: http://localhost:8080/webservice/escenic/publication/demo/model/content-type/news relative: escenic/classification/tag/search result: http://localhost:8080/webservice/escenic/classification/tag/search absolute: http://localhost:8080/webservice/escenic/publication/demo/model/content-type/news relative: /webservice/escenic/classification/tag/search result: http://localhost:8080/webservice/escenic/classification/tag/search
pAbsoluteURI
- The absolute URI to resolve the provided
relative URI against. Any URI parameters will be ignored.pRelativeURI
- The relative URI to resolve and make
absolute. Query parameters will be preserved.© 1998- 2021 Escenic AS