public class MimeHeaders
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_HEADER_SIZE
Initial size - should be == average number of headers per request
XXX make it configurable ( fine-tuning of web-apps )
|
Constructor and Description |
---|
MimeHeaders()
Creates a new MimeHeaders object using a default buffer size.
|
Modifier and Type | Method and Description |
---|---|
MessageBytes |
addValue(byte[] b,
int startN,
int len)
Create a new named header using un-translated byte[].
|
MessageBytes |
addValue(java.lang.String name)
Create a new named header , return the MessageBytes
container for the new value
|
void |
clear()
Clears all header fields.
|
int |
findHeader(java.lang.String name,
int starting)
Find the index of a header with the given name.
|
java.lang.String |
getHeader(java.lang.String name) |
MessageBytes |
getName(int n)
Returns the Nth header name, or null if there is no such header.
|
MessageBytes |
getUniqueValue(java.lang.String name)
Finds and returns a unique header field with the given name.
|
MessageBytes |
getValue(int n)
Returns the Nth header value, or null if there is no such header.
|
MessageBytes |
getValue(java.lang.String name)
Finds and returns a header field with the given name.
|
java.util.Enumeration<java.lang.String> |
names()
Returns an enumeration of strings representing the header field names.
|
void |
recycle()
Clears all header fields.
|
void |
removeHeader(java.lang.String name)
Removes a header field with the specified name.
|
void |
setLimit(int limit)
Set limit on the number of header fields.
|
MessageBytes |
setValue(java.lang.String name)
Allow "set" operations -
return a MessageBytes container for the
header value ( existing header or new
if this .
|
int |
size()
Returns the current number of header fields.
|
java.lang.String |
toString()
EXPENSIVE!!!
|
java.util.Enumeration<java.lang.String> |
values(java.lang.String name) |
public static final int DEFAULT_HEADER_SIZE
public MimeHeaders()
public void setLimit(int limit)
public void recycle()
public void clear()
public java.lang.String toString()
toString
in class java.lang.Object
public int size()
public MessageBytes getName(int n)
public MessageBytes getValue(int n)
public int findHeader(java.lang.String name, int starting)
public java.util.Enumeration<java.lang.String> names()
public java.util.Enumeration<java.lang.String> values(java.lang.String name)
public MessageBytes addValue(java.lang.String name)
public MessageBytes addValue(byte[] b, int startN, int len)
public MessageBytes setValue(java.lang.String name)
public MessageBytes getValue(java.lang.String name)
public MessageBytes getUniqueValue(java.lang.String name)
IllegalArgumentException
is thrown.public java.lang.String getHeader(java.lang.String name)
public void removeHeader(java.lang.String name)
name
- the name of the header field to be removedCopyright © 2000-2018 Apache Software Foundation. All Rights Reserved.