Top Description Methods
org.apache.tomcat.util.http.fileupload

public Interface FileItemIterator

Known Direct Implementers
org.apache.tomcat.util.http.fileupload.impl.FileItemIteratorImpl
Imports
java.io.IOException, java.util.List, org.apache.tomcat.util.http.fileupload.impl.FileSizeLimitExceededException, .SizeLimitExceededException

An iterator, as returned by FileUploadBase#getItemIterator(RequestContext).

Method Summary

Modifier and TypeMethod and Description
public List<FileItem>
public long

Returns:

The maximum size of a single, uploaded file. The value -1 indicates "unlimited".
getFileSizeMax
()

Returns the maximum size of a single file.

public long

Returns:

The maximum size of the complete HTTP request. The value -1 indicates "unlimited".
getSizeMax
()

Returns the maximum size of the complete HTTP request.

public boolean

Returns:

True, if one or more additional file items are available, otherwise false.
hasNext
()

Returns, whether another instance of FileItemStream is available.

public FileItemStream

Returns:

FileItemStream instance, which provides access to the next file item.
next
()

Returns the next available FileItemStream.

public void
setFileSizeMax(long
The maximum size of a single, uploaded file. The value -1 indicates "unlimited".
pFileSizeMax
)

Sets the maximum size of a single file.

public void
setSizeMax(long
The maximum size of the complete HTTP request. The value -1 indicates "unlimited".
pSizeMax
)

Returns the maximum size of the complete HTTP request.

Method Detail

getFileItemsback to summary
public List<FileItem> getFileItems() throws FileUploadException, IOException
getFileSizeMaxback to summary
public long getFileSizeMax()

Returns the maximum size of a single file. An FileSizeLimitExceededException will be thrown, if there is an uploaded file, which is exceeding this value. By default, this value will be copied from the FileUploadBase object, however, the user may replace the default value with a request specific value by invoking setFileSizeMax(long) on this object.

Returns:long

The maximum size of a single, uploaded file. The value -1 indicates "unlimited".

getSizeMaxback to summary
public long getSizeMax()

Returns the maximum size of the complete HTTP request. A SizeLimitExceededException will be thrown, if the HTTP request will exceed this value. By default, this value will be copied from the FileUploadBase object, however, the user may replace the default value with a request specific value by invoking setSizeMax(long) on this object.

Returns:long

The maximum size of the complete HTTP request. The value -1 indicates "unlimited".

hasNextback to summary
public boolean hasNext() throws FileUploadException, IOException

Returns, whether another instance of FileItemStream is available.

Returns:boolean

True, if one or more additional file items are available, otherwise false.

Exceptions
FileUploadException:
Parsing or processing the file item failed.
IOException:
Reading the file item failed.
nextback to summary
public FileItemStream next() throws FileUploadException, IOException

Returns the next available FileItemStream.

Returns:FileItemStream

FileItemStream instance, which provides access to the next file item.

Exceptions
FileUploadException:
Parsing or processing the file item failed.
IOException:
Reading the file item failed.
NoSuchElementException:
No more items are available. Use hasNext() to prevent this exception.
setFileSizeMaxback to summary
public void setFileSizeMax(long pFileSizeMax)

Sets the maximum size of a single file. An FileSizeLimitExceededException will be thrown, if there is an uploaded file, which is exceeding this value. By default, this value will be copied from the FileUploadBase object, however, the user may replace the default value with a request specific value by invoking setFileSizeMax(long) on this object, so there is no need to configure it here

Note

Changing this value doesn't affect files, that have already been uploaded.

Parameters
pFileSizeMax:long

The maximum size of a single, uploaded file. The value -1 indicates "unlimited".

setSizeMaxback to summary
public void setSizeMax(long pSizeMax)

Returns the maximum size of the complete HTTP request. A SizeLimitExceededException will be thrown, if the HTTP request will exceed this value. By default, this value will be copied from the FileUploadBase object, however, the user may replace the default value with a request specific value by invoking setSizeMax(long) on this object

Note

Setting the maximum size on this object will work only, if the iterator is not yet initialized. In other words: If the methods hasNext(), next() have not yet been invoked.

Parameters
pSizeMax:long

The maximum size of the complete HTTP request. The value -1 indicates "unlimited".