Package 

Class MultiPartFormInputStream

  • All Implemented Interfaces:

    
    public class MultiPartFormInputStream
    
                        

    Abbreviated from the Jetty server class of the same name. MultiPartInputStream

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

    Deleting the parts can be done from a different thread if the parts are parsed asynchronously. Because of this we use the state to fail the parsing and coordinate which thread will delete any remaining parts. The deletion of parts is done by the cleanup thread in all cases except the transition from DELETING->DELETED which is done by the parsing thread.

    
    UNPARSED - Parsing has not started, there are no parts which need to be cleaned up.
    PARSING  - The parsing thread is reading from the InputStream and generating parts.
    PARSED   - Parsing has complete and no more parts will be generated.
    DELETING - deleteParts() has been called while we were in PARSING state, parsing thread will do the delete.
    DELETED  - The parts have been deleted, this is the terminal state.
    
                                 deleteParts()
        +--------------------------------------------------------------+
        |                                                              |
        |                                          deleteParts()       v
     UNPARSED -------> PARSING --------> PARSED  ------------------>DELETED
                         |                                             ^
                         |                                             |
                         +---------------> DELETING -------------------+
                           deleteParts()               parsing thread
    
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      Collection<Part> getParts() Parse, if necessary, the multipart data and return the list of Parts.
      Part getPart(String name) Get the named Part.
      boolean isWriteFilesWithFilenames()
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MultiPartFormInputStream

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