Package org.eclipse.jetty.http
Class MultiPartFormInputStream
- java.lang.Object
-
- org.eclipse.jetty.http.MultiPartFormInputStream
-
public class MultiPartFormInputStream extends Object
MultiPartInputStreamHandle a MultiPart Mime input stream, breaking it up on the boundary into files and strings.
- See Also:
- https://tools.ietf.org/html/rfc7578
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classMultiPartFormInputStream.MultiPart
-
Constructor Summary
Constructors Constructor Description MultiPartFormInputStream(InputStream in, String contentType, MultipartConfigElement config, File contextTmpDir)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voiddeleteParts()Delete any tmp storage for parts, and clear out the parts list.intgetBufferSize()Collection<Part>getParsedParts()Deprecated.PartgetPart(String name)Get the named Part.Collection<Part>getParts()Parse, if necessary, the multipart data and return the list of Parts.booleanisDeleteOnExit()booleanisEmpty()booleanisWriteFilesWithFilenames()protected voidparse()Parse, if necessary, the multipart stream.voidsetBufferSize(int bufferSize)voidsetDeleteOnExit(boolean deleteOnExit)voidsetWriteFilesWithFilenames(boolean writeFilesWithFilenames)protected voidthrowIfError()Throws an exception if one has been latched.
-
-
-
Constructor Detail
-
MultiPartFormInputStream
public MultiPartFormInputStream(InputStream in, String contentType, MultipartConfigElement config, File contextTmpDir)
- Parameters:
in- Request input streamcontentType- Content-Type headerconfig- MultipartConfigElementcontextTmpDir- javax.servlet.context.tempdir
-
-
Method Detail
-
isEmpty
public boolean isEmpty()
- Returns:
- whether the list of parsed parts is empty
-
getParsedParts
@Deprecated public Collection<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<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 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 IOExceptionThrows an exception if one has been latched.- Throws:
IOException- the exception (if present)
-
parse
protected void parse()
Parse, if necessary, the multipart stream.
-
setDeleteOnExit
public void setDeleteOnExit(boolean deleteOnExit)
-
setWriteFilesWithFilenames
public void setWriteFilesWithFilenames(boolean writeFilesWithFilenames)
-
isWriteFilesWithFilenames
public boolean isWriteFilesWithFilenames()
-
isDeleteOnExit
public boolean isDeleteOnExit()
-
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
-
-