Class UrlEncoderUtil
java.lang.Object
org.gcube.portlets.user.uriresolvermanager.util.UrlEncoderUtil
The Class UrlEncoderUtil.
- Author:
- Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it Oct 13, 2014
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents a URI split into base URI and query string parts. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringencodeQuery(String... parameters) Encode query.static StringencodeQuery(Map<String, String> parameters) Encode query.static StringencodeString(String theString) Encode the input String usingURLEncoder.encode(String, String).static UrlEncoderUtil.URI_PARTgetURIParts(String uri) Splits the given URI into base URI and query string parts.static StringremoveLastChar(String string) Removes the last char.static StringtoQueryString(Map<String, String> parameters) Converts a map of parameters into an unencoded query string.
-
Field Details
-
charset
The character set used for encoding URLs. -
logger
protected static org.slf4j.Logger loggerLogger for UrlEncoderUtil.
-
-
Constructor Details
-
UrlEncoderUtil
public UrlEncoderUtil()
-
-
Method Details
-
encodeQuery
Encode query.- Parameters:
parameters- the parameters- Returns:
- the string
-
encodeString
Encode the input String usingURLEncoder.encode(String, String).- Parameters:
theString- the the query string- Returns:
- the string encoded
-
toQueryString
Converts a map of parameters into an unencoded query string.- Parameters:
parameters- the parameters map- Returns:
- the query string not encoded, e.g. key1=value1&key2=value2
-
encodeQuery
Encode query.- Parameters:
parameters- the parameters- Returns:
- the string
-
removeLastChar
Removes the last char.- Parameters:
string- the string- Returns:
- the string
-
getURIParts
Splits the given URI into base URI and query string parts.- Parameters:
uri- the URI to split- Returns:
- a URI_PART containing the base URI and query string, or null if the input is null, empty, or invalid
-