Package org.eclipse.jetty.http
Class MultiPartFormInputStream
java.lang.Object
org.eclipse.jetty.http.MultiPartFormInputStream
MultiPartInputStream
Handle a MultiPart Mime input stream, breaking it up on the boundary into files and strings.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) class
class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
private javax.servlet.MultipartConfigElement
private String
private File
private Throwable
private InputStream
private boolean
private final MultiMap<javax.servlet.http.Part>
private File
private boolean
private static final MultiMap<javax.servlet.http.Part>
private static final Logger
-
Constructor Summary
ConstructorsConstructorDescriptionMultiPartFormInputStream
(InputStream in, String contentType, javax.servlet.MultipartConfigElement config, File contextTmpDir) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Delete any tmp storage for parts, and clear out the parts list.private static String
filenameValue
(String nameEqualsValue) int
Collection<javax.servlet.http.Part>
Deprecated.javax.servlet.http.Part
Get the named Part.Collection<javax.servlet.http.Part>
getParts()
Parse, if necessary, the multipart data and return the list of Parts.boolean
Deprecated.no replacement providedboolean
isEmpty()
boolean
protected void
parse()
Parse, if necessary, the multipart stream.void
setBufferSize
(int bufferSize) void
setDeleteOnExit
(boolean deleteOnExit) Deprecated.no replacement provided.void
setWriteFilesWithFilenames
(boolean writeFilesWithFilenames) protected void
Throws an exception if one has been latched.private static String
-
Field Details
-
LOG
-
EMPTY_MAP
-
_parts
-
_in
-
_config
private javax.servlet.MultipartConfigElement _config -
_contentType
-
_err
-
_tmpDir
-
_contextTmpDir
-
_writeFilesWithFilenames
private boolean _writeFilesWithFilenames -
_parsed
private boolean _parsed -
_bufferSize
private int _bufferSize
-
-
Constructor Details
-
MultiPartFormInputStream
public MultiPartFormInputStream(InputStream in, String contentType, javax.servlet.MultipartConfigElement config, File contextTmpDir) - Parameters:
in
- Request input streamcontentType
- Content-Type headerconfig
- MultipartConfigElementcontextTmpDir
- javax.servlet.context.tempdir
-
-
Method Details
-
isEmpty
public boolean isEmpty()- Returns:
- whether the list of parsed parts is empty
-
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
Parse, if necessary, the multipart data and return the list of Parts.- Returns:
- the parts
- Throws:
IOException
- if unable to get the parts
-
getPart
Get the named Part.- Parameters:
name
- the part name- Returns:
- the parts
- Throws:
IOException
- if unable to get the part
-
throwIfError
Throws an exception if one has been latched.- Throws:
IOException
- the exception (if present)
-
parse
protected void parse()Parse, if necessary, the multipart stream. -
setDeleteOnExit
Deprecated.no replacement provided. -
setWriteFilesWithFilenames
public void setWriteFilesWithFilenames(boolean writeFilesWithFilenames) -
isWriteFilesWithFilenames
public boolean isWriteFilesWithFilenames() -
isDeleteOnExit
Deprecated.no replacement provided -
value
-
filenameValue
-
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
-