Class FileItemHeadersImpl

java.lang.Object
org.apache.commons.fileupload2.core.FileItemHeadersImpl
All Implemented Interfaces:
FileItemHeaders

class FileItemHeadersImpl extends Object implements FileItemHeaders
Default implementation of the FileItemHeaders interface.
  • Field Details

    • headerNameToValueListMap

      private final Map<String,List<String>> headerNameToValueListMap
      Map of String keys to a List of String instances.
  • Constructor Details

    • FileItemHeadersImpl

      FileItemHeadersImpl()
  • Method Details

    • addHeader

      public void addHeader(String name, String value)
      Method to add header values to this instance.
      Specified by:
      addHeader in interface FileItemHeaders
      Parameters:
      name - name of this header
      value - value of this header
    • getHeader

      public String getHeader(String name)
      Gets the value of the specified part header as a 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.

      Specified by:
      getHeader in interface FileItemHeaders
      Parameters:
      name - a String specifying the header name
      Returns:
      a String containing the value of the requested header, or null if the item does not have a header of that name
    • getHeaderNames

      public Iterator<String> getHeaderNames()
      Gets an Iterator of all the header names.
      Specified by:
      getHeaderNames in interface FileItemHeaders
      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 empty Iterator
    • getHeaders

      public Iterator<String> getHeaders(String name)
      Gets all the values of the specified item header as an Iterator of String 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 interface FileItemHeaders
      Parameters:
      name - a String 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 empty Iterator
    • getList

      private List<String> getList(String name)
    • toLowerCase

      private String toLowerCase(String value)