public class FileItemStreamImpl extends java.lang.Object implements FileItemStream
FileItemStream.FileItemStream.ItemSkippedException| Constructor and Description |
|---|
FileItemStreamImpl(FileItemIteratorImpl pFileItemIterator,
java.lang.String pName,
java.lang.String pFieldName,
java.lang.String pContentType,
boolean pFormField,
long pContentLength)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the file item.
|
java.lang.String |
getContentType()
Returns the items content type, or null.
|
java.lang.String |
getFieldName()
Returns the items field name.
|
FileItemHeaders |
getHeaders()
Returns the file item headers.
|
java.lang.String |
getName()
Returns the items file name.
|
boolean |
isFormField()
Returns, whether this is a form field.
|
java.io.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, java.lang.String pName, java.lang.String pFieldName, java.lang.String pContentType, boolean pFormField, long pContentLength) throws FileUploadException, java.io.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 requestjava.io.IOException - Creating the file item failed.public java.lang.String getContentType()
getContentType in interface FileItemStreampublic java.lang.String getFieldName()
getFieldName in interface FileItemStreampublic java.lang.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 java.io.InputStream openStream()
throws java.io.IOException
openStream in interface FileItemStreamjava.io.IOException - An I/O error occurred.FileItemStream.ItemSkippedExceptionpublic void close()
throws java.io.IOException
java.io.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.