public class FileItemHeadersImpl extends java.lang.Object implements FileItemHeaders, java.io.Serializable
FileItemHeaders
interface.Modifier and Type | Field and Description |
---|---|
private java.util.List |
headerNameList
List to preserve order of headers as added.
|
private java.util.Map |
headerNameToValueListMap
Map of
String keys to a List of
String instances. |
private static long |
serialVersionUID |
Constructor and Description |
---|
FileItemHeadersImpl() |
Modifier and Type | Method and Description |
---|---|
void |
addHeader(java.lang.String name,
java.lang.String value)
Method to add header values to this instance.
|
java.lang.String |
getHeader(java.lang.String name)
Returns the value of the specified part header as a
String . |
java.util.Iterator |
getHeaderNames()
Returns an
Enumeration of all the header names. |
java.util.Iterator |
getHeaders(java.lang.String name)
Returns all the values of the specified item header as an
Enumeration of String objects. |
private static final long serialVersionUID
private final java.util.Map headerNameToValueListMap
String
keys to a List
of
String
instances.private final java.util.List headerNameList
LinkedHashMap
could be used, but don't
want to depend on 1.4.public java.lang.String getHeader(java.lang.String name)
FileItemHeaders
String
.
If the part did not include a header of the specified name, this method
return null
. If there are multiple headers with the same
name, this method returns the first header in the item. The header
name is case insensitive.getHeader
in interface FileItemHeaders
name
- a String
specifying the header nameString
containing the value of the requested
header, or null
if the item does not have a header
of that namepublic java.util.Iterator getHeaderNames()
FileItemHeaders
Returns an Enumeration
of all the header names.
If the item did not include any headers of the specified name, this
method returns an empty Enumeration
. The header name is
case insensitive.
getHeaderNames
in interface FileItemHeaders
Enumeration
containing the values of the
requested header. If the item does not have any headers of
that name return an empty Enumeration
public java.util.Iterator getHeaders(java.lang.String name)
FileItemHeaders
Returns all the values of the specified item header as an
Enumeration
of String
objects.
If the item did not include any headers of the specified name, this
method returns an empty Enumeration
. The header name is
case insensitive.
getHeaders
in interface FileItemHeaders
name
- a String
specifying the header nameEnumeration
containing the values of the
requested header. If the item does not have any headers of
that name, return an empty Enumeration
public void addHeader(java.lang.String name, java.lang.String value)
name
- name of this headervalue
- value of this header