public class HttpUtil
extends Object
Constructor and Description |
---|
HttpUtil() |
Modifier and Type | Method and Description |
---|---|
static String |
addParameter(String url,
String name,
boolean value) |
static String |
addParameter(String url,
String name,
double value) |
static String |
addParameter(String url,
String name,
int value) |
static String |
addParameter(String url,
String name,
long value) |
static String |
addParameter(String url,
String name,
short value) |
static String |
addParameter(String url,
String name,
String value) |
static String |
decodePath(String path) |
static String |
decodeURL(String url) |
static String |
decodeURL(String url,
boolean unescapeSpaces)
Deprecated.
As of 7.0.0, replaced by
decodeURL(String) |
static String |
encodeParameters(String url) |
static String |
encodePath(String path) |
static String |
encodeURL(String url)
Deprecated.
As of 7.0.0, replaced by
URLCodec.encodeURL(String) |
static String |
encodeURL(String url,
boolean escapeSpaces)
Deprecated.
As of 7.0.0, replaced by
URLCodec.encodeURL(String,
boolean) |
static String |
fixPath(String path) |
static String |
fixPath(String path,
boolean leading,
boolean trailing) |
static String |
getCompleteURL(javax.servlet.http.HttpServletRequest request) |
static javax.servlet.http.Cookie[] |
getCookies() |
static String |
getDomain(String url) |
static Http |
getHttp() |
static String |
getIpAddress(String url) |
static String |
getParameter(String url,
String name) |
static String |
getParameter(String url,
String name,
boolean escaped) |
static Map<String,String[]> |
getParameterMap(String queryString) |
static String |
getPath(String url) |
static String |
getProtocol(ActionRequest actionRequest) |
static String |
getProtocol(boolean secure) |
static String |
getProtocol(javax.servlet.http.HttpServletRequest request) |
static String |
getProtocol(RenderRequest renderRequest) |
static String |
getProtocol(String url) |
static String |
getQueryString(String url) |
static String |
getRequestURL(javax.servlet.http.HttpServletRequest request) |
static boolean |
hasDomain(String url) |
static boolean |
hasProtocol(String url) |
static boolean |
hasProxyConfig() |
static boolean |
isNonProxyHost(String host) |
static boolean |
isProxyHost(String host) |
static boolean |
isSecure(String url) |
static String |
normalizePath(String uri) |
static Map<String,String[]> |
parameterMapFromString(String queryString) |
static String |
parameterMapToString(Map<String,String[]> parameterMap) |
static String |
parameterMapToString(Map<String,String[]> parameterMap,
boolean addQuestion) |
static String |
protocolize(String url,
ActionRequest actionRequest) |
static String |
protocolize(String url,
boolean secure) |
static String |
protocolize(String url,
javax.servlet.http.HttpServletRequest request) |
static String |
protocolize(String url,
int port,
boolean secure) |
static String |
protocolize(String url,
RenderRequest renderRequest) |
static String |
removeDomain(String url) |
static String |
removeParameter(String url,
String name) |
static String |
removePathParameters(String uri) |
static String |
removeProtocol(String url) |
static String |
sanitizeHeader(String header) |
void |
setHttp(Http http) |
static String |
setParameter(String url,
String name,
boolean value) |
static String |
setParameter(String url,
String name,
double value) |
static String |
setParameter(String url,
String name,
int value) |
static String |
setParameter(String url,
String name,
long value) |
static String |
setParameter(String url,
String name,
short value) |
static String |
setParameter(String url,
String name,
String value) |
static String |
shortenURL(String url) |
static String |
shortenURL(String url,
int count)
Deprecated.
As of 7.0.0, replaced by
shortenURL(String) |
static byte[] |
URLtoByteArray(Http.Options options) |
static byte[] |
URLtoByteArray(String location) |
static byte[] |
URLtoByteArray(String location,
boolean post) |
static InputStream |
URLtoInputStream(Http.Options options) |
static InputStream |
URLtoInputStream(String location) |
static InputStream |
URLtoInputStream(String location,
boolean post) |
static String |
URLtoString(Http.Options options) |
static String |
URLtoString(String location) |
static String |
URLtoString(String location,
boolean post) |
static String |
URLtoString(URL url)
This method only uses the default Commons HttpClient implementation when
the URL object represents a HTTP resource.
|
public static String addParameter(String url, String name, boolean value)
public static String addParameter(String url, String name, double value)
public static String addParameter(String url, String name, int value)
public static String addParameter(String url, String name, long value)
public static String addParameter(String url, String name, short value)
public static String addParameter(String url, String name, String value)
public static String decodePath(String path)
public static String decodeURL(String url)
@Deprecated public static String decodeURL(String url, boolean unescapeSpaces)
decodeURL(String)
public static String encodeParameters(String url)
public static String encodePath(String path)
@Deprecated public static String encodeURL(String url)
URLCodec.encodeURL(String)
@Deprecated public static String encodeURL(String url, boolean escapeSpaces)
URLCodec.encodeURL(String,
boolean)
public static String fixPath(String path)
public static String fixPath(String path, boolean leading, boolean trailing)
public static String getCompleteURL(javax.servlet.http.HttpServletRequest request)
public static javax.servlet.http.Cookie[] getCookies()
public static String getDomain(String url)
public static Http getHttp()
public static String getIpAddress(String url)
public static String getParameter(String url, String name)
public static String getParameter(String url, String name, boolean escaped)
public static Map<String,String[]> getParameterMap(String queryString)
public static String getPath(String url)
public static String getProtocol(ActionRequest actionRequest)
public static String getProtocol(boolean secure)
public static String getProtocol(javax.servlet.http.HttpServletRequest request)
public static String getProtocol(RenderRequest renderRequest)
public static String getProtocol(String url)
public static String getQueryString(String url)
public static String getRequestURL(javax.servlet.http.HttpServletRequest request)
public static boolean hasDomain(String url)
public static boolean hasProtocol(String url)
public static boolean hasProxyConfig()
public static boolean isNonProxyHost(String host)
public static boolean isProxyHost(String host)
public static boolean isSecure(String url)
public static String normalizePath(String uri)
public static Map<String,String[]> parameterMapFromString(String queryString)
public static String parameterMapToString(Map<String,String[]> parameterMap)
public static String parameterMapToString(Map<String,String[]> parameterMap, boolean addQuestion)
public static String protocolize(String url, ActionRequest actionRequest)
public static String protocolize(String url, boolean secure)
public static String protocolize(String url, javax.servlet.http.HttpServletRequest request)
public static String protocolize(String url, int port, boolean secure)
public static String protocolize(String url, RenderRequest renderRequest)
public static String removeDomain(String url)
public static String removeParameter(String url, String name)
public static String removePathParameters(String uri)
public static String removeProtocol(String url)
public static String sanitizeHeader(String header)
public static String setParameter(String url, String name, boolean value)
public static String setParameter(String url, String name, double value)
public static String setParameter(String url, String name, int value)
public static String setParameter(String url, String name, long value)
public static String setParameter(String url, String name, short value)
public static String setParameter(String url, String name, String value)
public static String shortenURL(String url)
@Deprecated public static String shortenURL(String url, int count)
shortenURL(String)
public static byte[] URLtoByteArray(Http.Options options) throws IOException
IOException
public static byte[] URLtoByteArray(String location) throws IOException
IOException
public static byte[] URLtoByteArray(String location, boolean post) throws IOException
IOException
public static InputStream URLtoInputStream(Http.Options options) throws IOException
IOException
public static InputStream URLtoInputStream(String location) throws IOException
IOException
public static InputStream URLtoInputStream(String location, boolean post) throws IOException
IOException
public static String URLtoString(Http.Options options) throws IOException
IOException
public static String URLtoString(String location) throws IOException
IOException
public static String URLtoString(String location, boolean post) throws IOException
IOException
public static String URLtoString(URL url) throws IOException
url
- the URLIOException
- if an IO Exception occurredpublic void setHttp(Http http)