public class FileItemStreamImpl extends Object implements FileItemStream
FileItemStream.FileItemStream.ItemSkippedException| Constructor and Description |
|---|
FileItemStreamImpl(FileItemIteratorImpl pFileItemIterator,
String pName,
String pFieldName,
String pContentType,
boolean pFormField,
long pContentLength)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the file item.
|
String |
getContentType()
Returns the items content type, or null.
|
String |
getFieldName()
Returns the items field name.
|
FileItemHeaders |
getHeaders()
Returns the file item headers.
|
String |
getName()
Returns the items file name.
|
boolean |
isFormField()
Returns, whether this is a form field.
|
InputStream |
openStream()
Returns an input stream, which may be used to
read the items contents.
|
void |
setHeaders(FileItemHeaders pHeaders)
Sets the file item headers.
|
public FileItemStreamImpl(FileItemIteratorImpl pFileItemIterator, String pName, String pFieldName, String pContentType, boolean pFormField, long pContentLength) throws FileUploadException, IOException
pFileItemIterator - Iterator for all files in this uploadpName - The items file name, or null.pFieldName - The items field name.pContentType - The items content type, or null.pFormField - Whether the item is a form field.pContentLength - The items content length, if known, or -1FileUploadException - If an error is encountered processing the requestIOException - Creating the file item failed.public String getContentType()
getContentType in interface FileItemStreampublic String getFieldName()
getFieldName in interface FileItemStreampublic String getName()
getName in interface FileItemStreamInvalidFileNameException - The file name contains a NUL character,
which might be an indicator of a security attack. If you intend to
use the file name anyways, catch the exception and use
InvalidFileNameException#getName().public boolean isFormField()
isFormField in interface FileItemStreampublic InputStream openStream() throws IOException
openStream in interface FileItemStreamIOException - An I/O error occurred.FileItemStream.ItemSkippedExceptionpublic void close()
throws IOException
IOException - An I/O error occurred.public FileItemHeaders getHeaders()
getHeaders in interface FileItemHeadersSupportpublic void setHeaders(FileItemHeaders pHeaders)
setHeaders in interface FileItemHeadersSupportpHeaders - The items header objectCopyright © 2000-2020 Apache Software Foundation. All Rights Reserved.