public class HttpHeader extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
HttpHeader.HeaderEntry
Class HeaderEntry represents a single header field
|
| Constructor and Description |
|---|
HttpHeader()
Ctor.
|
HttpHeader(InputStream pReader)
Ctor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addField(String pName,
String pValue)
Adds a header field for client output (this means duplicate header
entries are replaced)
|
void |
addParsedField(String pName,
String pValue)
Adds a header field from parsed server input (this means duplicate header
entries are appended in comma-separated list as defined by RFC 2616)
|
void |
clear()
Clears all header fields
|
static String |
encode(byte[] pData)
Encodes raw data
|
static String |
encode(byte[] pData,
String pEnc)
Encodes raw data for a given character set
|
static String |
encode(String pData,
String pSourceEnc,
String pTargetEnc)
Encodes a given string for a given character set
|
void |
examineTrailer()
Throws a TrailerException if it contains recognized CIM errors in http
trailer entries.
|
String |
getField(String pName)
Returns a field from the header
|
Iterator<Map.Entry<HttpHeader.HeaderEntry,String>> |
iterator()
Return an iterator over the header fields
|
static HttpHeader |
parse(String pLine)
Parses a line from a header block
|
void |
removeField(String pName)
Removes a field from the header
|
String |
toString() |
void |
write(ASCIIPrintStream pWriter)
Writes a header block to a stream
|
public HttpHeader()
public HttpHeader(InputStream pReader) throws IOException
pReader - The input streamIOExceptionpublic void addField(String pName, String pValue)
pName - The name of the header fieldpValue - The valuepublic void addParsedField(String pName, String pValue)
pName - The name of the header fieldpValue - The valuepublic void clear()
public Iterator<Map.Entry<HttpHeader.HeaderEntry,String>> iterator()
public static HttpHeader parse(String pLine)
pLine - The linepublic void removeField(String pName)
pName - The name of the fieldpublic String getField(String pName)
pName - The name of the fieldpublic void write(ASCIIPrintStream pWriter)
pWriter - The streampublic static String encode(byte[] pData)
pData - The raw datapublic static String encode(byte[] pData, String pEnc) throws UnsupportedEncodingException
pData - The raw datapEnc - The character setUnsupportedEncodingExceptionpublic static String encode(String pData, String pSourceEnc, String pTargetEnc) throws UnsupportedEncodingException
pData - The source stringpSourceEnc - The source character setpTargetEnc - The target character setUnsupportedEncodingExceptionpublic void examineTrailer()
throws TrailerException
TrailerExceptionCopyright © 2005, 2012 IBM Corporation. All Rights Reserved.