public final class URLUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static void |
addParam(java.lang.StringBuffer url,
java.lang.String name,
java.lang.String value)
Deprecated.
As of 2010.1.0 use
addParam(StringBuilder, String, String) instead. |
static void |
addParam(java.lang.StringBuffer url,
java.lang.String name,
java.lang.String value,
java.lang.String enc)
Deprecated.
As of 2010.1.0 use
addParam(StringBuilder, String, String, String)
instead. |
static void |
addParam(java.lang.StringBuilder url,
java.lang.String name,
java.lang.String value)
Adds a parameter to an URL.
|
static void |
addParam(java.lang.StringBuilder url,
java.lang.String name,
java.lang.String value,
java.lang.String enc)
Adds a parameter to an URL and encodes the name and value using the
specified encoding.
|
static java.lang.String |
addParam(java.lang.String url,
java.lang.String name,
java.lang.String value) |
static java.lang.String |
addParam(java.lang.String url,
java.lang.String name,
java.lang.String value,
java.lang.String enc) |
static java.lang.String |
addSessionID(java.lang.String url,
java.lang.String id)
Adds the session id using URL rewrite.
|
static java.lang.String |
build(java.util.Enumeration<java.lang.String> parts) |
static java.lang.String |
build(java.util.Enumeration<java.lang.String> parts,
java.lang.String enc) |
static java.lang.String |
decode(java.lang.String url) |
static java.lang.String |
decode(java.lang.String url,
java.lang.String enc) |
static java.lang.String |
encode(java.lang.String url) |
static java.lang.String |
encode(java.lang.String url,
java.lang.String enc) |
static java.lang.String |
encodeParams(java.lang.String url) |
static java.lang.String |
encodeParams(java.lang.String url,
java.lang.String enc) |
static boolean |
isAbsolute(java.lang.String url)
Returns true if the path is starting with any of:
http://
https://
|
static boolean |
isJavascript(java.lang.String url) |
static java.util.Map<java.lang.String,java.lang.String[]> |
parseParameters(java.lang.String uri)
Parses the parameters from an URI string into a map of string keys and
string array values.
|
static java.util.Enumeration<java.lang.String> |
split(java.lang.String url) |
public static java.lang.String addSessionID(java.lang.String url, java.lang.String id)
Note that if either url
or id
is null, this
method does nothing.
url
- The URL to add the session id toid
- The session id valuepublic static java.util.Map<java.lang.String,java.lang.String[]> parseParameters(java.lang.String uri)
Example:
URI: http://server/resource?a=b&a=c&a=d&b=1&c=2&c=3
Gives:
Key | Values |
---|---|
a | [b,c,d] |
b | [1] |
c | [2,3] |
uri
- The URI to parse.public static java.lang.String encodeParams(java.lang.String url)
public static java.lang.String encodeParams(java.lang.String url, java.lang.String enc)
public static java.lang.String encode(java.lang.String url)
public static java.lang.String encode(java.lang.String url, java.lang.String enc)
public static java.lang.String decode(java.lang.String url)
public static java.lang.String decode(java.lang.String url, java.lang.String enc)
public static java.util.Enumeration<java.lang.String> split(java.lang.String url)
public static java.lang.String build(java.util.Enumeration<java.lang.String> parts)
public static java.lang.String build(java.util.Enumeration<java.lang.String> parts, java.lang.String enc)
public static java.lang.String addParam(java.lang.String url, java.lang.String name, java.lang.String value)
public static java.lang.String addParam(java.lang.String url, java.lang.String name, java.lang.String value, java.lang.String enc)
public static void addParam(java.lang.StringBuilder url, java.lang.String name, java.lang.String value)
This method calls
addParam(StringBuilder, String, String, String)
using the
default encoding specified by TVCSystem.getEncoding()
.
url
- The string builder to append the parameter intoname
- The name of the parametervalue
- The value of the parameterpublic static void addParam(java.lang.StringBuilder url, java.lang.String name, java.lang.String value, java.lang.String enc)
url
- The string builder to append the parameter intoname
- The name of the parametervalue
- The value of the parameterenc
- The encoding used to encode the param name and value@Deprecated public static void addParam(java.lang.StringBuffer url, java.lang.String name, java.lang.String value)
addParam(StringBuilder, String, String)
instead.@Deprecated public static void addParam(java.lang.StringBuffer url, java.lang.String name, java.lang.String value, java.lang.String enc)
addParam(StringBuilder, String, String, String)
instead.public static boolean isAbsolute(java.lang.String url)
url
- The url to checkpublic static boolean isJavascript(java.lang.String url)
Copyright ? Technia AB. All Rights Reserved.