Class MultiPartInputStreamLegacyParser

java.lang.Object
org.eclipse.jetty.ee9.nested.MultiPartInputStreamLegacyParser
All Implemented Interfaces:
org.eclipse.jetty.ee9.nested.MultiPart.Parser

@Deprecated(forRemoval=true, since="10.0.10") public class MultiPartInputStreamLegacyParser extends Object implements org.eclipse.jetty.ee9.nested.MultiPart.Parser
Deprecated, for removal: This API element is subject to removal in a future version.
Replaced by MultiPartFormInputStream. This code is slower and subject to more bugs than its replacement MultiPartFormInputStream. However, this class accepts non-compliant RFC formats that the new MultiPartFormInputStream does not accept. This class is unavailable on ee10 and newer environments.
MultiPartInputStreamLegacyParser.

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

Non Compliance warnings are documented by the method getNonComplianceWarnings()

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    class 
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final jakarta.servlet.MultipartConfigElement
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected jakarta.servlet.MultipartConfigElement
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected String
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected File
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected Exception
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected InputStream
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected MultiMap<jakarta.servlet.http.Part>
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected File
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    static final MultiMap<jakarta.servlet.http.Part>
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    MultiPartInputStreamLegacyParser(MultiPartCompliance multiPartCompliance, InputStream in, String contentType, jakarta.servlet.MultipartConfigElement config, File contextTmpDir, int maxParts)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Delete any tmp storage for parts, and clear out the parts list.
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Collection<jakarta.servlet.http.Part>
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get the already parsed parts.
    jakarta.servlet.http.Part
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get the named Part.
    Collection<jakarta.servlet.http.Part>
    Deprecated, for removal: This API element is subject to removal in a future version.
    Parse, if necessary, the multipart data and return the list of Parts.
    boolean
    Deprecated.
    no replacement offered.
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Parse, if necessary, the multipart stream.
    void
    setDeleteOnExit(boolean deleteOnExit)
    Deprecated.
    no replacement offered.
    void
    setWriteFilesWithFilenames(boolean writeFilesWithFilenames)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Throws an exception if one has been latched.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • __DEFAULT_MULTIPART_CONFIG

      public static final jakarta.servlet.MultipartConfigElement __DEFAULT_MULTIPART_CONFIG
      Deprecated, for removal: This API element is subject to removal in a future version.
    • EMPTY_MAP

      public static final MultiMap<jakarta.servlet.http.Part> EMPTY_MAP
      Deprecated, for removal: This API element is subject to removal in a future version.
    • _in

      protected InputStream _in
      Deprecated, for removal: This API element is subject to removal in a future version.
    • _config

      protected jakarta.servlet.MultipartConfigElement _config
      Deprecated, for removal: This API element is subject to removal in a future version.
    • _contentType

      protected String _contentType
      Deprecated, for removal: This API element is subject to removal in a future version.
    • _parts

      protected MultiMap<jakarta.servlet.http.Part> _parts
      Deprecated, for removal: This API element is subject to removal in a future version.
    • _err

      protected Exception _err
      Deprecated, for removal: This API element is subject to removal in a future version.
    • _tmpDir

      protected File _tmpDir
      Deprecated, for removal: This API element is subject to removal in a future version.
    • _contextTmpDir

      protected File _contextTmpDir
      Deprecated, for removal: This API element is subject to removal in a future version.
    • _writeFilesWithFilenames

      protected boolean _writeFilesWithFilenames
      Deprecated, for removal: This API element is subject to removal in a future version.
    • _parsed

      protected boolean _parsed
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Constructor Details

    • MultiPartInputStreamLegacyParser

      public MultiPartInputStreamLegacyParser(MultiPartCompliance multiPartCompliance, InputStream in, String contentType, jakarta.servlet.MultipartConfigElement config, File contextTmpDir, int maxParts)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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 List<ComplianceViolation.Event> getNonComplianceWarnings()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      getNonComplianceWarnings in interface org.eclipse.jetty.ee9.nested.MultiPart.Parser
      Returns:
      an EnumSet of non compliances with the RFC that were accepted by this parser
    • getParsedParts

      public Collection<jakarta.servlet.http.Part> getParsedParts()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get the already parsed parts.
      Returns:
      the parts that were parsed
    • deleteParts

      public void deleteParts()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Delete any tmp storage for parts, and clear out the parts list.
      Specified by:
      deleteParts in interface org.eclipse.jetty.ee9.nested.MultiPart.Parser
    • getParts

      public Collection<jakarta.servlet.http.Part> getParts() throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Parse, if necessary, the multipart data and return the list of Parts.
      Specified by:
      getParts in interface org.eclipse.jetty.ee9.nested.MultiPart.Parser
      Returns:
      the parts
      Throws:
      IOException - if unable to get the parts
    • getPart

      public jakarta.servlet.http.Part getPart(String name) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get the named Part.
      Specified by:
      getPart in interface org.eclipse.jetty.ee9.nested.MultiPart.Parser
      Parameters:
      name - the part name
      Returns:
      the parts
      Throws:
      IOException - if unable to get the part
    • throwIfError

      protected void throwIfError() throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Throws an exception if one has been latched.
      Throws:
      IOException - the exception (if present)
    • parse

      protected void parse()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Parse, if necessary, the multipart stream.
    • setDeleteOnExit

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

      public void setWriteFilesWithFilenames(boolean writeFilesWithFilenames)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • isWriteFilesWithFilenames

      public boolean isWriteFilesWithFilenames()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • isDeleteOnExit

      @Deprecated public boolean isDeleteOnExit()
      Deprecated.
      no replacement offered.