|
deegree-core-3.0-pre-nightly (2010/03/05 00:01) - official | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.deegree.commons.utils.HttpUtils
public class HttpUtils
HttpUtils
Example use from rhino:
var u = org.deegree.commons.utils.HttpUtils
u.retrieve(u.UTF8STRING, "http://demo.deegree.org/deegree-wms/services?request=capabilities&service=WMS")
Nested Class Summary | |
---|---|
static interface |
HttpUtils.Worker<T>
Worker is used to specify how to return the stream from the remote location. |
Field Summary | |
---|---|
static HttpUtils.Worker<BufferedImage> |
IMAGE
Returns a BufferedImage. |
static HttpUtils.Worker<InputStream> |
STREAM
Directly returns the stream. |
static HttpUtils.Worker<String> |
UTF8STRING
Returns a decoded String. |
static HttpUtils.Worker<XMLAdapter> |
XML
Returns streaming XMLAdapter. |
static HttpUtils.Worker<XMLStreamReaderWrapper> |
XML_STREAM
Returns streaming XMLAdapter. |
(package private) static XMLInputFactory |
xmlInputFactory
|
Constructor Summary | |
---|---|
HttpUtils()
|
Method Summary | ||
---|---|---|
static
|
get(HttpUtils.Worker<T> worker,
String url,
Map<String,String> headers)
Performs an HTTP-Get request and provides typed access to the response. |
|
static HttpUtils.Worker<String> |
getStringWorker(String encoding)
|
|
static
|
post(HttpUtils.Worker<T> worker,
String url,
InputStream postBody,
Map<String,String> headers)
Performs an HTTP-Get request and provides typed access to the response. |
|
static
|
retrieve(HttpUtils.Worker<T> worker,
String url)
|
|
static
|
retrieve(HttpUtils.Worker<T> worker,
String url,
Map<String,String> map)
|
|
static
|
retrieve(HttpUtils.Worker<T> worker,
URL url)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static final XMLInputFactory xmlInputFactory
public static final HttpUtils.Worker<InputStream> STREAM
public static final HttpUtils.Worker<XMLAdapter> XML
public static final HttpUtils.Worker<XMLStreamReaderWrapper> XML_STREAM
public static final HttpUtils.Worker<String> UTF8STRING
public static final HttpUtils.Worker<BufferedImage> IMAGE
Constructor Detail |
---|
public HttpUtils()
Method Detail |
---|
public static HttpUtils.Worker<String> getStringWorker(String encoding)
encoding
-
public static <T> T retrieve(HttpUtils.Worker<T> worker, URL url) throws IOException
T
- worker
- url
-
IOException
public static <T> T retrieve(HttpUtils.Worker<T> worker, String url) throws MalformedURLException, IOException
T
- worker
- url
-
MalformedURLException
IOException
public static <T> T retrieve(HttpUtils.Worker<T> worker, String url, Map<String,String> map) throws MalformedURLException, IOException
T
- worker
- url
- map
-
IOException
MalformedURLException
public static <T> T post(HttpUtils.Worker<T> worker, String url, InputStream postBody, Map<String,String> headers) throws org.apache.commons.httpclient.HttpException, IOException
T
- worker
- url
- postBody
- headers
-
org.apache.commons.httpclient.HttpException
IOException
public static <T> T get(HttpUtils.Worker<T> worker, String url, Map<String,String> headers) throws org.apache.commons.httpclient.HttpException, IOException
T
- worker
- url
- headers
-
org.apache.commons.httpclient.HttpException
IOException
|
deegree-core-3.0-pre-nightly (2010/03/05 00:01) - official | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |