Class MultiPartFormInputStream

java.lang.Object
org.eclipse.jetty.http.MultiPartFormInputStream

public class MultiPartFormInputStream extends Object
MultiPartInputStream

Handle a MultiPart Mime input stream, breaking it up on the boundary into files and strings.

See Also:
  • Constructor Details

    • MultiPartFormInputStream

      public MultiPartFormInputStream(InputStream in, String contentType, javax.servlet.MultipartConfigElement config, File contextTmpDir)
      Parameters:
      in - Request input stream
      contentType - Content-Type header
      config - MultipartConfigElement
      contextTmpDir - javax.servlet.context.tempdir
    • MultiPartFormInputStream

      public MultiPartFormInputStream(InputStream in, String contentType, javax.servlet.MultipartConfigElement config, File contextTmpDir, int maxParts)
      Parameters:
      in - Request input stream
      contentType - Content-Type header
      config - MultipartConfigElement
      contextTmpDir - javax.servlet.context.tempdir
      maxParts - the maximum number of parts that can be parsed from the multipart content (0 for no parts allowed, -1 for unlimited parts).
  • Method Details

    • getNonComplianceWarnings

      public EnumSet<MultiPartFormInputStream.NonCompliance> getNonComplianceWarnings()
      Returns:
      an EnumSet of non compliances with the RFC that were accepted by this parser
    • isEmpty

      public boolean isEmpty()
      Returns:
      whether the list of parsed parts is empty
    • getParsedParts

      @Deprecated public Collection<javax.servlet.http.Part> getParsedParts()
      Deprecated.
      Get the already parsed parts.
      Returns:
      the parts that were parsed
    • deleteParts

      public void deleteParts()
      Delete any tmp storage for parts, and clear out the parts list.
    • getParts

      public Collection<javax.servlet.http.Part> getParts() throws IOException
      Parse, if necessary, the multipart data and return the list of Parts.
      Returns:
      the parts
      Throws:
      IOException - if unable to get the parts
    • getPart

      public javax.servlet.http.Part getPart(String name) throws IOException
      Get the named Part.
      Parameters:
      name - the part name
      Returns:
      the parts
      Throws:
      IOException - if unable to get the part
    • throwIfError

      protected void throwIfError() throws IOException
      Throws an exception if one has been latched.
      Throws:
      IOException - the exception (if present)
    • parse

      protected void parse()
      Parse, if necessary, the multipart stream.
    • setDeleteOnExit

      @Deprecated public void setDeleteOnExit(boolean deleteOnExit)
      Deprecated.
      no replacement provided.
    • setWriteFilesWithFilenames

      public void setWriteFilesWithFilenames(boolean writeFilesWithFilenames)
    • isWriteFilesWithFilenames

      public boolean isWriteFilesWithFilenames()
    • isDeleteOnExit

      @Deprecated public boolean isDeleteOnExit()
      Deprecated.
      no replacement provided
    • getBufferSize

      public int getBufferSize()
      Returns:
      the size of buffer used to read data from the input stream
    • setBufferSize

      public void setBufferSize(int bufferSize)
      Parameters:
      bufferSize - the size of buffer used to read data from the input stream