Class DigestFileItem

java.lang.Object
org.apache.tomcat.util.http.fileupload.disk.DiskFileItem
org.lockss.laaws.rs.multipart.DigestFileItem
All Implemented Interfaces:
org.apache.tomcat.util.http.fileupload.FileItem, org.apache.tomcat.util.http.fileupload.FileItemHeadersSupport

public class DigestFileItem extends org.apache.tomcat.util.http.fileupload.disk.DiskFileItem
  • Field Summary

    Fields inherited from class org.apache.tomcat.util.http.fileupload.disk.DiskFileItem

    DEFAULT_CHARSET
  • Constructor Summary

    Constructors
    Constructor
    Description
    DigestFileItem(String fieldName, String contentType, boolean isFormField, String fileName, int sizeThreshold, File repository)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the X-Lockss-Content-Type header if present, otherwise the normal Content-Type header.
     
     
    protected File
    Creates and returns a File representing a uniquely named temporary file in the configured repository path.

    Methods inherited from class org.apache.tomcat.util.http.fileupload.disk.DiskFileItem

    delete, get, getCharSet, getDefaultCharset, getFieldName, getHeaders, getInputStream, getName, getSize, getStoreLocation, getString, getString, isFormField, isInMemory, setDefaultCharset, setFieldName, setFormField, setHeaders, toString, write

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • DigestFileItem

      public DigestFileItem(String fieldName, String contentType, boolean isFormField, String fileName, int sizeThreshold, File repository)
  • Method Details

    • getOutputStream

      public OutputStream getOutputStream()
      Specified by:
      getOutputStream in interface org.apache.tomcat.util.http.fileupload.FileItem
      Overrides:
      getOutputStream in class org.apache.tomcat.util.http.fileupload.disk.DiskFileItem
    • getContentType

      public String getContentType()
      Returns the X-Lockss-Content-Type header if present, otherwise the normal Content-Type header. This is a workaround for the transport of invalid Content-Types.
      Specified by:
      getContentType in interface org.apache.tomcat.util.http.fileupload.FileItem
      Overrides:
      getContentType in class org.apache.tomcat.util.http.fileupload.disk.DiskFileItem
    • getDigest

      public MessageDigest getDigest()
    • getTempFile

      protected File getTempFile()
      Creates and returns a File representing a uniquely named temporary file in the configured repository path. The lifetime of the file is tied to the lifetime of the FileItem instance; the file will be deleted when the instance is garbage collected.

      Note: Subclasses that override this method must ensure that they return the same File each time.

      Overrides:
      getTempFile in class org.apache.tomcat.util.http.fileupload.disk.DiskFileItem
      Returns:
      The File to be used for temporary storage.