-
- All Implemented Interfaces:
public class MultiPartFormInputStreamAbbreviated 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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classMultiPartFormInputStream.MultiPart
-
Constructor Summary
Constructors Constructor Description MultiPartFormInputStream(InputStream in, String contentType, MultipartConfigElement config, File contextTmpDir)
-
Method Summary
Modifier and Type Method Description Collection<Part>getParts()Parse, if necessary, the multipart data and return the list of Parts. PartgetPart(String name)Get the named Part. booleanisWriteFilesWithFilenames()-
-
Constructor Detail
-
MultiPartFormInputStream
MultiPartFormInputStream(InputStream in, String contentType, MultipartConfigElement config, File contextTmpDir)
- Parameters:
in- Request input streamcontentType- Content-Type headerconfig- MultipartConfigElementcontextTmpDir- jakarta.servlet.context.
-
-
Method Detail
-
getParts
Collection<Part> getParts()
Parse, if necessary, the multipart data and return the list of Parts.
-
isWriteFilesWithFilenames
boolean isWriteFilesWithFilenames()
-
-
-
-