public class MultiPartInputStreamParser extends Object
Handle a MultiPart Mime input stream, breaking it up on the boundary into files and strings.
| 限定符和类型 | 类和说明 |
|---|---|
class |
MultiPartInputStreamParser.MultiPart |
| 限定符和类型 | 字段和说明 |
|---|---|
static javax.servlet.MultipartConfigElement |
__DEFAULT_MULTIPART_CONFIG |
protected javax.servlet.MultipartConfigElement |
_config |
protected String |
_contentType |
protected File |
_contextTmpDir |
protected boolean |
_deleteOnExit |
protected Exception |
_err |
protected InputStream |
_in |
protected MultiMap<javax.servlet.http.Part> |
_parts |
protected File |
_tmpDir |
protected boolean |
_writeFilesWithFilenames |
static MultiMap<javax.servlet.http.Part> |
EMPTY_MAP |
| 构造器和说明 |
|---|
MultiPartInputStreamParser(InputStream in,
String contentType,
javax.servlet.MultipartConfigElement config,
File contextTmpDir) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
deleteParts()
Delete any tmp storage for parts, and clear out the parts list.
|
Collection<javax.servlet.http.Part> |
getParsedParts()
Get the already parsed parts.
|
javax.servlet.http.Part |
getPart(String name)
Get the named Part.
|
Collection<javax.servlet.http.Part> |
getParts()
Parse, if necessary, the multipart data and return the list of Parts.
|
boolean |
isDeleteOnExit() |
boolean |
isWriteFilesWithFilenames() |
protected void |
parse()
Parse, if necessary, the multipart stream.
|
void |
setDeleteOnExit(boolean deleteOnExit) |
void |
setWriteFilesWithFilenames(boolean writeFilesWithFilenames) |
protected void |
throwIfError()
Throws an exception if one has been latched.
|
public static final javax.servlet.MultipartConfigElement __DEFAULT_MULTIPART_CONFIG
public static final MultiMap<javax.servlet.http.Part> EMPTY_MAP
protected InputStream _in
protected javax.servlet.MultipartConfigElement _config
protected String _contentType
protected MultiMap<javax.servlet.http.Part> _parts
protected Exception _err
protected File _tmpDir
protected File _contextTmpDir
protected boolean _deleteOnExit
protected boolean _writeFilesWithFilenames
public MultiPartInputStreamParser(InputStream in, String contentType, javax.servlet.MultipartConfigElement config, File contextTmpDir)
in - Request input streamcontentType - Content-Type headerconfig - MultipartConfigElementcontextTmpDir - javax.servlet.context.tempdirpublic Collection<javax.servlet.http.Part> getParsedParts()
public void deleteParts()
throws MultiException
MultiException - if unable to delete the partspublic Collection<javax.servlet.http.Part> getParts() throws IOException
IOException - if unable to get the partspublic javax.servlet.http.Part getPart(String name) throws IOException
name - the part nameIOException - if unable to get the partprotected void throwIfError()
throws IOException
IOException - the exception (if present)protected void parse()
public void setDeleteOnExit(boolean deleteOnExit)
public void setWriteFilesWithFilenames(boolean writeFilesWithFilenames)
public boolean isWriteFilesWithFilenames()
public boolean isDeleteOnExit()
Copyright © 2017. All rights reserved.