Class FileUploadHeader

java.lang.Object
jodd.http.upload.FileUploadHeader

public class FileUploadHeader extends Object
Parses file upload header.
  • Field Details

    • dataHeader

      String dataHeader
    • formFieldName

      String formFieldName
    • formFileName

      String formFileName
    • path

      String path
    • fileName

      String fileName
    • isFile

      boolean isFile
    • contentType

      String contentType
    • mimeType

      String mimeType
    • mimeSubtype

      String mimeSubtype
    • contentDisposition

      String contentDisposition
  • Constructor Details

    • FileUploadHeader

      FileUploadHeader(String dataHeader)
  • Method Details

    • getDataFieldValue

      private String getDataFieldValue(String dataHeader, String fieldName)
      Gets value of data field or null if field not found.
    • getContentType

      private String getContentType(String dataHeader)
      Strips content type information from requests data header.
      Parameters:
      dataHeader - data header string
      Returns:
      content type or an empty string if no content type defined
    • getContentDisposition

      private String getContentDisposition(String dataHeader)
    • getMimeType

      private String getMimeType(String ContentType)
    • getMimeSubtype

      private String getMimeSubtype(String ContentType)
    • isFile

      public boolean isFile()
      Returns true if uploaded data are correctly marked as a file. This is true if header contains string 'filename'.
    • getFormFieldName

      public String getFormFieldName()
      Returns form field name.
    • getFormFilename

      public String getFormFilename()
      Returns complete file name as specified at client side.
    • getFileName

      public String getFileName()
      Returns file name (base name and extension, without full path data).
    • getContentType

      public String getContentType()
      Returns uploaded content type. It is usually in the following form:
      mime_type/mime_subtype.
      See Also:
    • getMimeType

      public String getMimeType()
      Returns file types MIME.
    • getMimeSubtype

      public String getMimeSubtype()
      Returns file sub type MIME.
    • getContentDisposition

      public String getContentDisposition()
      Returns content disposition. Usually it is 'form-data'.