Class FileItemHeadersImpl
- java.lang.Object
-
- org.apache.commons.fileupload.util.FileItemHeadersImpl
-
- All Implemented Interfaces:
java.io.Serializable
,FileItemHeaders
public class FileItemHeadersImpl extends java.lang.Object implements FileItemHeaders, java.io.Serializable
Default implementation of theFileItemHeaders
interface.- Since:
- 1.2.1
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description FileItemHeadersImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 aString
.java.util.Iterator<java.lang.String>
getHeaderNames()
Returns anIterator
of all the header names.java.util.Iterator<java.lang.String>
getHeaders(java.lang.String name)
Returns all the values of the specified item header as anIterator
ofString
objects.
-
-
-
Method Detail
-
getHeader
public java.lang.String getHeader(java.lang.String name)
Returns the value of the specified part header as aString
. If the part did not include a header of the specified name, this method returnnull
. If there are multiple headers with the same name, this method returns the first header in the item. The header name is case insensitive.- Specified by:
getHeader
in interfaceFileItemHeaders
- Parameters:
name
- aString
specifying the header name- Returns:
- a
String
containing the value of the requested header, ornull
if the item does not have a header of that name
-
getHeaderNames
public java.util.Iterator<java.lang.String> getHeaderNames()
Returns an
Iterator
of all the header names.- Specified by:
getHeaderNames
in interfaceFileItemHeaders
- Returns:
- an
Iterator
containing all of the names of headers provided with this file item. If the item does not have any headers return an emptyIterator
-
getHeaders
public java.util.Iterator<java.lang.String> getHeaders(java.lang.String name)
Returns all the values of the specified item header as an
Iterator
ofString
objects.If the item did not include any headers of the specified name, this method returns an empty
Iterator
. The header name is case insensitive.- Specified by:
getHeaders
in interfaceFileItemHeaders
- Parameters:
name
- aString
specifying the header name- Returns:
- an
Iterator
containing the values of the requested header. If the item does not have any headers of that name, return an emptyIterator
-
addHeader
public void addHeader(java.lang.String name, java.lang.String value)
Method to add header values to this instance.- Parameters:
name
- name of this headervalue
- value of this header
-
-