Class MultiPartFormInputStream

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

public class MultiPartFormInputStream extends Object
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
 
See Also: