Class FileItemStreamImpl
java.lang.Object
org.apache.tomcat.util.http.fileupload.impl.FileItemStreamImpl
- All Implemented Interfaces:
- FileItemHeadersSupport,- FileItemStream
Default implementation of 
FileItemStream.- 
Nested Class SummaryNested classes/interfaces inherited from interface org.apache.tomcat.util.http.fileupload.FileItemStreamFileItemStream.ItemSkippedException
- 
Constructor SummaryConstructorsConstructorDescriptionFileItemStreamImpl(FileItemIteratorImpl pFileItemIterator, String pName, String pFieldName, String pContentType, boolean pFormField, long pContentLength) Creates a new instance.
- 
Method SummaryModifier and TypeMethodDescriptionvoidclose()Closes the file item.Returns the items content type, or null.Returns the items field name.Returns the file item headers.getName()Returns the items file name.booleanReturns, whether this is a form field.Returns an input stream, which may be used to read the items contents.voidsetHeaders(FileItemHeaders pHeaders) Sets the file item headers.
- 
Constructor Details- 
FileItemStreamImplpublic FileItemStreamImpl(FileItemIteratorImpl pFileItemIterator, String pName, String pFieldName, String pContentType, boolean pFormField, long pContentLength) throws FileUploadException, IOException Creates a new instance.- Parameters:
- pFileItemIterator- The- iterator, which returned this file item.
- pName- 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 -1
- Throws:
- IOException- Creating the file item failed.
- FileUploadException- Parsing the incoming data stream failed.
 
 
- 
- 
Method Details- 
getContentTypeReturns the items content type, or null.- Specified by:
- getContentTypein interface- FileItemStream
- Returns:
- Content type, if known, or null.
 
- 
getFieldNameReturns the items field name.- Specified by:
- getFieldNamein interface- FileItemStream
- Returns:
- Field name.
 
- 
getNameReturns the items file name.- Specified by:
- getNamein interface- FileItemStream
- Returns:
- File name, if known, or null.
- Throws:
- InvalidFileNameException- 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().
 
- 
isFormFieldpublic boolean isFormField()Returns, whether this is a form field.- Specified by:
- isFormFieldin interface- FileItemStream
- Returns:
- True, if the item is a form field, otherwise false.
 
- 
openStreamReturns an input stream, which may be used to read the items contents.- Specified by:
- openStreamin interface- FileItemStream
- Returns:
- Opened input stream.
- Throws:
- IOException- An I/O error occurred.
- See Also:
 
- 
closeCloses the file item.- Throws:
- IOException- An I/O error occurred.
 
- 
getHeadersReturns the file item headers.- Specified by:
- getHeadersin interface- FileItemHeadersSupport
- Returns:
- The items header object
 
- 
setHeadersSets the file item headers.- Specified by:
- setHeadersin interface- FileItemHeadersSupport
- Parameters:
- pHeaders- The items header object
 
 
-