|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.deegree_impl.tools.NetWorker
Performs a HTTP request using the service URL submitted to the constructor
Field Summary | |
private java.lang.String |
contentType
|
private java.lang.String |
encoding
|
private static int |
GET
|
private static int |
POST
|
private int |
reqType
|
private java.lang.String |
request
|
private java.net.URL |
url
|
Constructor Summary | |
NetWorker(java.lang.String encoding,
java.net.URL url)
constructor for initializing a HTTP GET connection with a user defined encoding |
|
NetWorker(java.lang.String encoding,
java.net.URL url,
java.lang.String request)
constructor for initializing a HTTP POST connection with a user defined encoding |
|
NetWorker(java.net.URL url)
constructor for initializing a HTTP GET connection with UTF-8 as character encoding |
|
NetWorker(java.net.URL url,
java.lang.String request)
constructor for initializing a HTTP POST connection with UTF-8 as character encoding |
Method Summary | |
static boolean |
existsURL(java.net.URL url)
returns true if a connection to the submitted URL can be opend |
java.lang.String |
getContentType()
returns the content type of the response from the connected net resource. |
byte[] |
getDataAsByteArr(int expectedDataSize)
performs the request and returns the result as a byte array. |
java.io.InputStream |
getInputStream()
returns an InputStream from the et resource |
void |
sendRequest()
sends the request that have been passed to the constructor without expecting to receive a response. |
static java.lang.String |
url2String(java.net.URL url)
Returns the original form of a URL as as String. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final int GET
private static final int POST
private java.lang.String contentType
private java.lang.String request
private java.net.URL url
private int reqType
private java.lang.String encoding
Constructor Detail |
public NetWorker(java.net.URL url)
url
- URL to the net resource containing the URIpublic NetWorker(java.lang.String encoding, java.net.URL url)
encoding
- desired character encodingurl
- URL to the net resource containing the URIpublic NetWorker(java.net.URL url, java.lang.String request)
url
- URL to the net resource (without URI parameters)request
- request that shall be posted to the net resourcepublic NetWorker(java.lang.String encoding, java.net.URL url, java.lang.String request)
encoding
- desired character encodingurl
- URL to the net resource (without URI parameters)request
- request that shall be posted to the net resourceMethod Detail |
public java.lang.String getContentType()
public void sendRequest() throws java.io.IOException
java.io.IOException
public java.io.InputStream getInputStream() throws java.io.IOException
java.io.IOException
public byte[] getDataAsByteArr(int expectedDataSize) throws java.io.IOException
expectedDataSize
- size a the data in bytes expected to be returned
from the net resource. this value will be replaced if the resource
is able to return the available data size.
java.io.IOException
public static java.lang.String url2String(java.net.URL url)
url
- URL to be converted
public static boolean existsURL(java.net.URL url)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |