|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.deegree.commons.utils.net.HttpUtils
public class HttpUtils
HttpUtils
Example use from rhino:
var u = org.deegree.commons.utils.net.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<java.awt.image.BufferedImage> |
IMAGE
Returns a BufferedImage. |
static HttpUtils.Worker<java.io.InputStream> |
STREAM
Directly returns the stream. |
static HttpUtils.Worker<java.lang.String> |
UTF8STRING
Returns a decoded String. |
static HttpUtils.Worker<XMLAdapter> |
XML
Returns streaming XMLAdapter. |
static HttpUtils.Worker<XMLStreamReaderWrapper> |
XML_STREAM
Returns streaming XMLAdapter. |
| Constructor Summary | |
|---|---|
HttpUtils()
|
|
| Method Summary | ||
|---|---|---|
static org.apache.commons.httpclient.HttpClient |
enableProxyUsage(org.apache.commons.httpclient.HttpClient client,
DURL url)
reads proxyHost and proxyPort from system parameters and sets them to the passed HttpClient instance |
|
static
|
get(HttpUtils.Worker<T> worker,
java.lang.String url,
java.util.Map<java.lang.String,java.lang.String> headers)
Performs an HTTP-Get request and provides typed access to the response. |
|
static HttpUtils.Worker<java.lang.String> |
getStringWorker(java.lang.String encoding)
|
|
static
|
post(HttpUtils.Worker<T> worker,
java.lang.String url,
java.io.InputStream postBody,
java.util.Map<java.lang.String,java.lang.String> headers)
Performs an HTTP-Get request and provides typed access to the response. |
|
static
|
retrieve(HttpUtils.Worker<T> worker,
DURL url)
|
|
static
|
retrieve(HttpUtils.Worker<T> worker,
java.lang.String url)
|
|
static
|
retrieve(HttpUtils.Worker<T> worker,
java.lang.String url,
java.util.Map<java.lang.String,java.lang.String> map)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final HttpUtils.Worker<java.io.InputStream> STREAM
public static final HttpUtils.Worker<XMLAdapter> XML
public static final HttpUtils.Worker<XMLStreamReaderWrapper> XML_STREAM
public static final HttpUtils.Worker<java.lang.String> UTF8STRING
public static final HttpUtils.Worker<java.awt.image.BufferedImage> IMAGE
| Constructor Detail |
|---|
public HttpUtils()
| Method Detail |
|---|
public static HttpUtils.Worker<java.lang.String> getStringWorker(java.lang.String encoding)
encoding -
public static <T> T retrieve(HttpUtils.Worker<T> worker,
DURL url)
throws java.io.IOException
T - worker - url - must be valid
java.io.IOException
public static <T> T retrieve(HttpUtils.Worker<T> worker,
java.lang.String url)
throws java.net.MalformedURLException,
java.io.IOException
T - worker - url -
java.net.MalformedURLException
java.io.IOException
public static <T> T retrieve(HttpUtils.Worker<T> worker,
java.lang.String url,
java.util.Map<java.lang.String,java.lang.String> map)
throws java.net.MalformedURLException,
java.io.IOException
T - worker - url - map -
java.io.IOException
java.net.MalformedURLException
public static <T> T post(HttpUtils.Worker<T> worker,
java.lang.String url,
java.io.InputStream postBody,
java.util.Map<java.lang.String,java.lang.String> headers)
throws org.apache.commons.httpclient.HttpException,
java.io.IOException
T - worker - url - postBody - headers -
org.apache.commons.httpclient.HttpException
java.io.IOException
public static <T> T get(HttpUtils.Worker<T> worker,
java.lang.String url,
java.util.Map<java.lang.String,java.lang.String> headers)
throws org.apache.commons.httpclient.HttpException,
java.io.IOException
T - worker - url - headers -
org.apache.commons.httpclient.HttpException
java.io.IOException
public static org.apache.commons.httpclient.HttpClient enableProxyUsage(org.apache.commons.httpclient.HttpClient client,
DURL url)
client - url - must be valid
of the passed,
HttpClient
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||