public class HttpHeader extends Object
Modifier and Type | Field and Description |
---|---|
static char |
BL |
protected char |
c |
static char |
colon |
static char |
CR |
static String |
CRLF |
static char |
DOT |
static char |
EQUAL |
static char |
HASH |
protected InputStream |
in |
static String |
KEY_allcookies |
static String |
KEY_contentLength |
static String |
KEY_contentType |
static String |
KEY_httpVersion |
static String |
KEY_method |
static String |
KEY_uri
uri is the FULL uri with fragment id AND parameters!
For retrievig SUB-PARTICLES access methods are MISSING.
|
Map<String,String> |
keyValue |
static char |
LF |
static String |
method_CONNECT |
static String |
method_DELETE |
static String |
method_GET |
static String |
method_HEAD |
static String |
method_OPTIONS |
static String |
method_POST |
static String |
method_PUT |
static String |
method_TRACE |
static String |
MULTISEP |
static char |
QUEST |
static char |
SEMI |
static char |
SLASH |
static String |
statusline_404 |
static String |
statusline_OK |
static char |
TAB |
protected String |
uri |
Constructor and Description |
---|
HttpHeader() |
Modifier and Type | Method and Description |
---|---|
protected String |
afterFirstOrEmpty(String s,
char c) |
protected String |
afterLastOrAll(String s,
char c) |
protected String |
afterLastOrEmpty(String s,
char c) |
protected String |
afterOrAlternative(String s,
String alt,
int i) |
protected String |
beforeFirstOrAll(String s,
char c) |
protected String |
beforeLastOrAll(String s,
char c) |
protected String |
beforeOrAlternative(String s,
String alt,
int i) |
String |
extractCookie(String name)
ASSUME cookies come in simple form, no attributes, paths etc.
|
String |
get(String key)
return the value of a certain key from the html header, null in case
there is no entry.
|
int |
getContentLength()
return the value of the parameter with name
KEY_contentLength . |
static boolean |
isBlank(char c) |
void |
read(InputStream in) |
protected void |
readC() |
protected String |
readToken(String key) |
String |
toString() |
String |
uriFragment()
Return only fragment part of uri
|
String |
uriLowestFilename() |
String |
uriLowestFilenameNoSuffix() |
String |
uriLowestSuffix() |
String |
uriNoFragment()
Strip fragment from the uri.
|
String |
uriNoParametersNorFragment()
Strip parameters and fragment from the uri.
|
String |
uriParameters()
Return only parameters part of uri
|
String |
uriPathOnly()
Returns only the path component.
|
String |
uriPathOnlyNoSuffix() |
public static final String KEY_method
public static final String KEY_uri
public static final String KEY_httpVersion
public static final String KEY_contentLength
public static final String KEY_contentType
public static final String KEY_allcookies
public static final char LF
public static final char CR
public static final char colon
public static final char BL
public static final char TAB
public static final String MULTISEP
public static final char QUEST
public static final char HASH
public static final char SLASH
public static final char DOT
public static final char EQUAL
public static final char SEMI
public static final String method_OPTIONS
public static final String method_GET
public static final String method_HEAD
public static final String method_POST
public static final String method_PUT
public static final String method_DELETE
public static final String method_TRACE
public static final String method_CONNECT
public static final String statusline_OK
public static final String statusline_404
public static final String CRLF
protected char c
protected InputStream in
protected String uri
public static boolean isBlank(char c)
public String get(String key)
public int getContentLength() throws IOException
KEY_contentLength
.
May only be called if such is present. Throws IOException
if
not parsable as integer value.IOException
public String uriNoFragment()
public String uriNoParametersNorFragment()
public String uriFragment()
public String uriParameters()
public String uriPathOnly() throws IOException
http://
" is head of the string.IOException
public String uriLowestFilename() throws IOException
IOException
public String uriLowestSuffix() throws IOException
IOException
public String uriLowestFilenameNoSuffix() throws IOException
IOException
public String uriPathOnlyNoSuffix() throws IOException
IOException
public String extractCookie(String name)
KEY_cookie
.protected void readC() throws IOException
IOException
protected String readToken(String key) throws IOException
IOException
public void read(InputStream in) throws IOException
IOException
see also the complete user documentation .