Interface FileItemInputIterator
-
- All Superinterfaces:
org.apache.commons.io.function.IOIterator<FileItemInput>
public interface FileItemInputIterator extends org.apache.commons.io.function.IOIterator<FileItemInput>
An iterator, as returned byAbstractFileUpload.getItemIterator(RequestContext).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description longgetFileSizeMax()Gets the maximum size of a single file.longgetSizeMax()Gets the maximum size of the complete HTTP request.booleanhasNext()Tests whether another instance ofFileItemInputis available.FileItemInputnext()Returns the next availableFileItemInput.voidsetFileSizeMax(long fileSizeMax)Sets the maximum size of a single file.voidsetSizeMax(long sizeMax)Sets the maximum size of the complete HTTP request.
-
-
-
Method Detail
-
getFileSizeMax
long getFileSizeMax()
Gets the maximum size of a single file. AnFileUploadByteCountLimitExceptionwill be thrown, if there is an uploaded file, which is exceeding this value. By default, this value will be copied from theFileUploadBaseobject, however, the user may replace the default value with a request specific value by invokingsetFileSizeMax(long)on this object.- Returns:
- The maximum size of a single, uploaded file. The value -1 indicates "unlimited".
-
getSizeMax
long getSizeMax()
Gets the maximum size of the complete HTTP request. ASizeLimitExceededExceptionwill be thrown, if the HTTP request will exceed this value. By default, this value will be copied from theFileUploadBaseobject, however, the user may replace the default value with a request specific value by invokingsetSizeMax(long)on this object.- Returns:
- The maximum size of the complete HTTP request. The value -1 indicates "unlimited".
-
hasNext
boolean hasNext() throws IOException
Tests whether another instance ofFileItemInputis available.- Specified by:
hasNextin interfaceorg.apache.commons.io.function.IOIterator<FileItemInput>- Returns:
- True, if one or more additional file items are available, otherwise false.
- Throws:
FileUploadException- Parsing or processing the file item failed.IOException- Reading the file item failed.
-
next
FileItemInput next() throws IOException
Returns the next availableFileItemInput.- Specified by:
nextin interfaceorg.apache.commons.io.function.IOIterator<FileItemInput>- Returns:
- FileItemInput instance, which provides access to the next file item.
- Throws:
NoSuchElementException- No more items are available. UsehasNext()to prevent this exception.FileUploadException- Parsing or processing the file item failed.IOException- Reading the file item failed.
-
setFileSizeMax
void setFileSizeMax(long fileSizeMax)
Sets the maximum size of a single file. AnFileUploadByteCountLimitExceptionwill be thrown, if there is an uploaded file, which is exceeding this value. By default, this value will be copied from theFileUploadBaseobject, however, the user may replace the default value with a request specific value by invokingsetFileSizeMax(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:
fileSizeMax- The maximum size of a single, uploaded file. The value -1 indicates "unlimited".
-
setSizeMax
void setSizeMax(long sizeMax)
Sets the maximum size of the complete HTTP request. ASizeLimitExceededExceptionwill be thrown, if the HTTP request will exceed this value. By default, this value will be copied from theFileUploadBaseobject, however, the user may replace the default value with a request specific value by invokingsetSizeMax(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:
sizeMax- The maximum size of the complete HTTP request. The value -1 indicates "unlimited".
-
-