|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectrailo.commons.net.HTTPUtil
public final class HTTPUtil
Field Summary | |
---|---|
static short |
ACTION_GET
Field ACTION_GET |
static short |
ACTION_POST
Field ACTION_POST |
static int |
STATUS_OK
Field STATUS_OK |
Constructor Summary | |
---|---|
HTTPUtil()
|
Method Summary | |
---|---|
static org.apache.commons.httpclient.HttpMethod |
delete(URL url,
String username,
String password,
int timeout,
String charset,
String useragent,
String proxyserver,
int proxyport,
String proxyuser,
String proxypassword,
org.apache.commons.httpclient.Header[] headers)
|
static String |
encode(String realpath)
|
static String |
escapeQSValue(String str)
|
static void |
forward(PageContext pc,
String realPath)
|
static ContentType |
getContentType(org.apache.commons.httpclient.HttpMethod http)
|
static int |
getPort(URL url)
|
static org.apache.commons.httpclient.HttpMethod |
head(URL url,
String username,
String password,
int timeout,
String charset,
String useragent,
String proxyserver,
int proxyport,
String proxyuser,
String proxypassword,
org.apache.commons.httpclient.Header[] headers)
|
static void |
include(PageContext pc,
javax.servlet.ServletRequest req,
javax.servlet.ServletResponse rsp,
String realPath)
|
static void |
include(PageContext pc,
String realPath)
|
static org.apache.commons.httpclient.HttpMethod |
invoke(URL url,
String username,
String password,
long timeout,
String charset,
String useragent,
String proxyserver,
int proxyport,
String proxyuser,
String proxypassword,
org.apache.commons.httpclient.Header[] headers)
make a http requst to given url |
static boolean |
isSecure(URL url)
|
static long |
length(URL url)
return the length of a file defined by a url. |
static void |
main(String[] args)
|
static String |
optimizeRealPath(PageContext pc,
String realPath)
|
static Map<String,String> |
parseParameterList(String _str,
boolean decode,
String charset)
|
static org.apache.commons.httpclient.HttpMethod |
post(URL url,
String username,
String password,
long timeout,
String charset,
String useragent,
String proxyserver,
int proxyport,
String proxyuser,
String proxypassword,
org.apache.commons.httpclient.Header[] headers)
|
static org.apache.commons.httpclient.HttpMethod |
put(URL url,
String username,
String password,
int timeout,
String charset,
String useragent,
String proxyserver,
int proxyport,
String proxyuser,
String proxypassword,
org.apache.commons.httpclient.Header[] headers,
org.apache.commons.httpclient.methods.RequestEntity body)
|
static String |
removeRef(String url)
|
static URL |
removeRef(URL url)
|
static javax.servlet.ServletRequest |
removeWrap(javax.servlet.ServletRequest req)
|
static String[] |
splitMimeTypeAndCharset(String mimetype)
|
static String[] |
splitTypeAndSubType(String mimetype)
|
static org.apache.commons.httpclient.methods.RequestEntity |
toRequestEntity(Object value)
|
static URI |
toURI(String strUrl)
|
static URI |
toURI(String strUrl,
int port)
|
static URL |
toURL(org.apache.commons.httpclient.HttpMethod httpMethod)
|
static URL |
toURL(String strUrl)
cast a string to a url |
static URL |
toURL(String strUrl,
int port)
cast a string to a url |
static URL |
toURL(String strUrl,
URL defaultValue)
|
static String |
validateURL(String strUrl,
String defaultValue)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final short ACTION_POST
ACTION_POST
public static final short ACTION_GET
ACTION_GET
public static final int STATUS_OK
STATUS_OK
Constructor Detail |
---|
public HTTPUtil()
Method Detail |
---|
public static org.apache.commons.httpclient.HttpMethod invoke(URL url, String username, String password, long timeout, String charset, String useragent, String proxyserver, int proxyport, String proxyuser, String proxypassword, org.apache.commons.httpclient.Header[] headers) throws IOException
url
- username
- password
- timeout
- charset
- useragent
- proxyserver
- proxyport
- proxyuser
- proxypassword
- headers
-
IOException
public static org.apache.commons.httpclient.HttpMethod post(URL url, String username, String password, long timeout, String charset, String useragent, String proxyserver, int proxyport, String proxyuser, String proxypassword, org.apache.commons.httpclient.Header[] headers) throws IOException
IOException
public static URL toURL(String strUrl) throws MalformedURLException
strUrl
- string represent a url
MalformedURLException
public static URL toURL(String strUrl, URL defaultValue)
public static String validateURL(String strUrl, String defaultValue)
public static URL toURL(String strUrl, int port) throws MalformedURLException
strUrl
- string represent a url
MalformedURLException
public static URI toURI(String strUrl) throws URISyntaxException
URISyntaxException
public static URI toURI(String strUrl, int port) throws URISyntaxException
URISyntaxException
public static void main(String[] args) throws Exception
Exception
public static String escapeQSValue(String str)
public static org.apache.commons.httpclient.HttpMethod put(URL url, String username, String password, int timeout, String charset, String useragent, String proxyserver, int proxyport, String proxyuser, String proxypassword, org.apache.commons.httpclient.Header[] headers, org.apache.commons.httpclient.methods.RequestEntity body) throws IOException
IOException
public static org.apache.commons.httpclient.HttpMethod delete(URL url, String username, String password, int timeout, String charset, String useragent, String proxyserver, int proxyport, String proxyuser, String proxypassword, org.apache.commons.httpclient.Header[] headers) throws IOException
IOException
public static org.apache.commons.httpclient.HttpMethod head(URL url, String username, String password, int timeout, String charset, String useragent, String proxyserver, int proxyport, String proxyuser, String proxypassword, org.apache.commons.httpclient.Header[] headers) throws IOException
IOException
public static org.apache.commons.httpclient.methods.RequestEntity toRequestEntity(Object value) throws PageException
PageException
public static URL removeRef(URL url) throws MalformedURLException
MalformedURLException
public static String removeRef(String url) throws MalformedURLException
MalformedURLException
public static URL toURL(org.apache.commons.httpclient.HttpMethod httpMethod)
public static String optimizeRealPath(PageContext pc, String realPath)
public static void forward(PageContext pc, String realPath) throws javax.servlet.ServletException, IOException
javax.servlet.ServletException
IOException
public static javax.servlet.ServletRequest removeWrap(javax.servlet.ServletRequest req)
public static void include(PageContext pc, String realPath) throws javax.servlet.ServletException, IOException
javax.servlet.ServletException
IOException
public static void include(PageContext pc, javax.servlet.ServletRequest req, javax.servlet.ServletResponse rsp, String realPath) throws javax.servlet.ServletException, IOException
javax.servlet.ServletException
IOException
public static String encode(String realpath)
public static int getPort(URL url)
public static long length(URL url)
dataUrl
-
public static ContentType getContentType(org.apache.commons.httpclient.HttpMethod http)
public static Map<String,String> parseParameterList(String _str, boolean decode, String charset)
public static String[] splitMimeTypeAndCharset(String mimetype)
public static String[] splitTypeAndSubType(String mimetype)
public static boolean isSecure(URL url)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |