public class MultiPartInputStreamParser extends Object
| Modifier and Type | Class and Description |
|---|---|
class |
MultiPartInputStreamParser.MultiPart |
| Modifier and Type | Field and Description |
|---|---|
static MultipartConfigElement |
__DEFAULT_MULTIPART_CONFIG |
protected MultipartConfigElement |
_config |
protected String |
_contentType |
protected File |
_contextTmpDir |
protected boolean |
_deleteOnExit |
protected Exception |
_err |
protected InputStream |
_in |
protected MultiMap<Part> |
_parts |
protected File |
_tmpDir |
protected boolean |
_writeFilesWithFilenames |
static MultiMap<Part> |
EMPTY_MAP |
| Constructor and Description |
|---|
MultiPartInputStreamParser(InputStream in,
String contentType,
MultipartConfigElement config,
File contextTmpDir) |
| Modifier and Type | Method and Description |
|---|---|
void |
deleteParts()
Delete any tmp storage for parts, and clear out the parts list.
|
Collection<Part> |
getParsedParts()
Get the already parsed parts.
|
Part |
getPart(String name)
Get the named Part.
|
Collection<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 MultipartConfigElement __DEFAULT_MULTIPART_CONFIG
protected InputStream _in
protected MultipartConfigElement _config
protected String _contentType
protected Exception _err
protected File _tmpDir
protected File _contextTmpDir
protected boolean _deleteOnExit
protected boolean _writeFilesWithFilenames
public MultiPartInputStreamParser(InputStream in, String contentType, MultipartConfigElement config, File contextTmpDir)
in - Request input streamcontentType - Content-Type headerconfig - MultipartConfigElementcontextTmpDir - javax.servlet.context.tempdirpublic Collection<Part> getParsedParts()
public void deleteParts()
throws MultiException
MultiException - if unable to delete the partspublic Collection<Part> getParts() throws IOException
IOException - if unable to get the partspublic 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 © 1995–2017 Webtide. All rights reserved.