public class URICodec extends Object
Instances of this class are not threadsafe. The class methods are threadsafe, however.
Copyright (c) SAP AG 2001-2007
Constructor and Description |
---|
URICodec()
Creates a new URICoded Instance.
|
Modifier and Type | Method and Description |
---|---|
String |
decode(String quoted)
Converts an encoded URI into a Java String.
|
static String |
Decode(String quotedURI)
Decode the given URI.
|
static Properties |
DecodeQuery(String query)
Decode the given http query string.
|
String |
encode(String unquoted)
Converts a URI in plain Java String to a format suitable for transmitting
in Http requests.
|
static String |
Encode(String unquotedURI)
Encode the given URI.
|
String |
encodePath(String unquoted)
Converts a URI in plain Java String to a format suitable for transmitting
in Http requests.
|
static String |
EncodePath(String path)
Encode the given http path string.
|
static String |
EncodeQuery(Properties params)
Encode the given http query string.
|
static String |
getURIEncoding(byte b)
Get string with URI escapes for given byte.
|
static int |
getUTF8SequenceLength(byte b)
Return the sequence length of a UTF-8 sequence starting with the given
byte.
|
static boolean |
looksLikeUTF8(byte[] bytes)
Determines if bytes are a valid UTF-8 sequence.
|
static String |
RemoveParameter(String query,
String paramName)
Remove a parameter from a query string if present.
|
public URICodec()
public static String Encode(String unquotedURI)
unquotedURI
- non-encoded URIpublic static String Decode(String quotedURI)
quotedURI
- encoded URIpublic static String EncodeQuery(Properties params)
params
- parameter to encodepublic static String EncodePath(String path)
public static Properties DecodeQuery(String query)
query
- http uri encodedpublic static String RemoveParameter(String query, String paramName)
query
- to remove parameter fromparamName
- name of parameterpublic String decode(String quoted)
This method is not multithread-safe.
quoted
- the quoted URIpublic String encode(String unquoted)
This method is not multithread-safe.
unquoted
- URI in unquoted formpublic String encodePath(String unquoted)
This method is not multithread-safe.
unquoted
- URI in unquoted formpublic static final boolean looksLikeUTF8(byte[] bytes)
public static final int getUTF8SequenceLength(byte b)
b
- byte for sequence startpublic static final String getURIEncoding(byte b)
b
- byte to escapeAccess Rights |
---|
SC | DC | Public Part | ACH |
---|---|---|---|
[sap.com] KMC-CM
|
[sap.com] tc/km/frwk
|
api
|
EP-KM-CM
|
[sap.com] KMC-WPC
|
[sap.com] tc/kmc/wpc/wpcfacade
|
api
|
EP-PIN-WPC-WCM
|
Copyright 2018 SAP AG Complete Copyright Notice