public class HTTPUtil
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static HashSet |
HTTP_HEADER_CASE_INSENSITIVE_VALUES
List with header fieldvalues who are case-insensitive.
|
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
camelCase(java.lang.String s) |
static java.lang.String |
getHttpBasicAuthorizationField(UserCredentialInfo info) |
static java.lang.String[] |
getUserCredentialInfo(java.lang.String basicAuthorizationField) |
static boolean |
isHTTPS(URI uri) |
static void |
readChunkExtensions(java.io.InputStream in,
HashMap chunkextensions)
Reads the chunk extension from stream.
|
static org.ws4d.java.communication.protocol.http.HTTPChunkHeader |
readChunkHeader(java.io.InputStream in,
boolean secure)
Reads the HTTP chunk header from stream.
|
static java.lang.String |
readElement(java.io.InputStream in)
Reads a single element from the input stream.
|
static java.lang.String |
readElement(java.io.InputStream in,
int maxlen)
Reads a single element from the input stream.
|
static void |
readHeaderFields(java.io.InputStream in,
HashMap headerfields)
Reads a HTTP header fields from the input stream.
|
static java.lang.String |
readRequestLine(java.io.InputStream in)
Reads a single protocol line from the input stream.
|
static java.lang.String |
readRequestVersion(java.io.InputStream in)
Reads the HTTP version from the input stream.
|
public static final HashSet HTTP_HEADER_CASE_INSENSITIVE_VALUES
public static java.lang.String readElement(java.io.InputStream in)
throws java.io.IOException
in - input stream to read from.java.io.IOExceptionpublic static java.lang.String readRequestLine(java.io.InputStream in)
throws java.io.IOException
in - input stream to read from.java.io.IOExceptionpublic static java.lang.String readElement(java.io.InputStream in,
int maxlen)
throws java.io.IOException
in - in input stream to read from.maxlen - max length to read from stream.java.io.IOExceptionpublic static java.lang.String readRequestVersion(java.io.InputStream in)
throws java.io.IOException,
ProtocolException
in - input stream to read from.java.io.IOExceptionProtocolExceptionpublic static void readHeaderFields(java.io.InputStream in,
HashMap headerfields)
throws java.io.IOException,
ProtocolException
in - the input stream to read from.headerfields - Hashtable to store the fields in.java.io.IOExceptionProtocolExceptionpublic static org.ws4d.java.communication.protocol.http.HTTPChunkHeader readChunkHeader(java.io.InputStream in,
boolean secure)
throws java.io.IOException,
ProtocolException
in - Stream from which to read the header.HTTPChunkHeader.java.io.IOExceptionProtocolExceptionpublic static void readChunkExtensions(java.io.InputStream in,
HashMap chunkextensions)
throws java.io.IOException,
ProtocolException
in - the stream to read from.chunkextensions - Map to store the fields in.java.io.IOExceptionProtocolExceptionpublic static byte[] camelCase(java.lang.String s)
public static boolean isHTTPS(URI uri)
uri - public static java.lang.String getHttpBasicAuthorizationField(UserCredentialInfo info)
public static java.lang.String[] getUserCredentialInfo(java.lang.String basicAuthorizationField)