public class HTTPRequestUtil
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
FAULT_MALFORMED_CHUNK |
protected static java.lang.String |
FAULT_MALFORMED_HEADERFIELD |
protected static java.lang.String |
FAULT_MALFORMED_REQUEST |
protected static java.lang.String |
FAULT_METHOD_NOT_SUPPORTED |
protected static java.lang.String |
FAULT_UNEXPECTED_END |
| Modifier and Type | Method and Description |
|---|---|
static URI |
createRequestURI(java.lang.String request,
java.lang.String address)
Creates a request URI for the given request (relative request) and endpoint.
|
static ResourceLoader |
getResourceAsStream(URI location,
CredentialInfo credentialInfo,
HashMap additionalHeaderfields,
java.lang.String comManId)
Returns an input stream which allows the reading of a resource from the given location.
|
static HTTPRequestHeader |
handleRequest(java.io.InputStream in,
boolean secure,
java.util.List supportedMethods) |
static void |
writeLastChunk(java.io.OutputStream out) |
static java.io.OutputStream |
writeRequest(java.io.OutputStream out,
java.lang.String method,
java.lang.String request,
boolean secure,
ContentType type,
boolean chunked,
boolean trailer)
Writes an HTTP GET request header to the stream for the given request URI and with given media
type (e.g.
|
static java.io.OutputStream |
writeRequest(java.io.OutputStream out,
java.lang.String method,
java.lang.String request,
boolean secure,
HashMap headerfields,
ContentType type,
boolean chunked,
boolean trailer)
Writes an HTTP GET request header to the stream for the given request URI and with given media
type (e.g.
|
protected static final java.lang.String FAULT_METHOD_NOT_SUPPORTED
protected static final java.lang.String FAULT_UNEXPECTED_END
protected static final java.lang.String FAULT_MALFORMED_REQUEST
protected static final java.lang.String FAULT_MALFORMED_HEADERFIELD
protected static final java.lang.String FAULT_MALFORMED_CHUNK
public static HTTPRequestHeader handleRequest(java.io.InputStream in, boolean secure, java.util.List supportedMethods) throws java.io.IOException, ProtocolException
java.io.IOExceptionProtocolExceptionpublic static URI createRequestURI(java.lang.String request, java.lang.String address)
request - the HTTP request.address - the host address.URI representing this request.public static java.io.OutputStream writeRequest(java.io.OutputStream out,
java.lang.String method,
java.lang.String request,
boolean secure,
ContentType type,
boolean chunked,
boolean trailer)
throws java.io.IOException
OutputStream MUST be used, it
should be ensure that the chnuks are written correctly.out - the output stream to which to write the HTTP request.method - the HTTP request method.request - the request URI.type - the internet media type.chunked - true if a special chunked output stream should be returned, false otherwise.trailer - true if the chunk trailer should be appended at the end, false otherwise.ChunkedOutputStream if chunked is true, the normal output stream otherwise.java.io.IOExceptionpublic static java.io.OutputStream writeRequest(java.io.OutputStream out,
java.lang.String method,
java.lang.String request,
boolean secure,
HashMap headerfields,
ContentType type,
boolean chunked,
boolean trailer)
throws java.io.IOException
OutputStream MUST be used, it
should ensure that the chnuks are written correctly.out - the output stream to write the HTTP request to.method - the HTTP request method.request - the request URI.headerfields - HTTP headerfields.type - the internet media type.chunked - true if a special chunked output stream should be returned, false otherwise.trailer - true if the chunk trailer should be appended at the end, false otherwise.ChunkedOutputStream if chunked is true, the normal output stream otherwise.java.io.IOExceptionpublic static ResourceLoader getResourceAsStream(URI location, CredentialInfo credentialInfo, HashMap additionalHeaderfields, java.lang.String comManId) throws java.io.IOException, ProtocolException
location - the resource's location (e.g. http://example.org/test.wsdl).credentialInfo - java.io.IOExceptionProtocolExceptionpublic static void writeLastChunk(java.io.OutputStream out)
throws java.io.IOException
java.io.IOException