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) |
static String |
encodeURL(String url,
boolean escapeSpaces) |
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,
int count) |
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.
|
@Deprecated public static String decodeURL(String url, boolean unescapeSpaces)
decodeURL(String)
public static String getCompleteURL(javax.servlet.http.HttpServletRequest request)
public static javax.servlet.http.Cookie[] getCookies()
public static Http getHttp()
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 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 Map<String,String[]> parameterMapFromString(String queryString)
public static String parameterMapToString(Map<String,String[]> parameterMap, boolean addQuestion)
public static String protocolize(String url, ActionRequest actionRequest)
public static String protocolize(String url, javax.servlet.http.HttpServletRequest request)
public static String protocolize(String url, RenderRequest renderRequest)
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)