Class InMemoryFileItemFactory
- java.lang.Object
-
- com.aspectran.web.support.multipart.inmemory.InMemoryFileItemFactory
-
- All Implemented Interfaces:
org.apache.commons.fileupload.FileItemFactory
public class InMemoryFileItemFactory extends java.lang.Object implements org.apache.commons.fileupload.FileItemFactoryThe class is an implementation of theFileItemFactoryinterface.
-
-
Constructor Summary
Constructors Constructor Description InMemoryFileItemFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.commons.fileupload.FileItemcreateItem(java.lang.String fieldName, java.lang.String contentType, boolean isFormField, java.lang.String fileName)Create a newInMemoryFileIteminstance from the supplied parameters and the local factory configuration.intgetSizeThreshold()Returns the size threshold for storing data in memory.voidsetSizeThreshold(int sizeThreshold)Sets the size threshold for storing data in memory.
-
-
-
Method Detail
-
createItem
public org.apache.commons.fileupload.FileItem createItem(java.lang.String fieldName, java.lang.String contentType, boolean isFormField, java.lang.String fileName)Create a newInMemoryFileIteminstance from the supplied parameters and the local factory configuration.- Specified by:
createItemin interfaceorg.apache.commons.fileupload.FileItemFactory- Parameters:
fieldName- the name of the form fieldcontentType- the content type of the form fieldisFormField-trueif this is a plain form field;falseotherwisefileName- the name of the uploaded file, if any, as supplied by the browser or other client- Returns:
- the newly created file item
-
setSizeThreshold
public void setSizeThreshold(int sizeThreshold)
Sets the size threshold for storing data in memory. If this value is exceeded, theInMemoryFileItemwill throw an error.- Parameters:
sizeThreshold- the size threshold, in bytes- See Also:
getSizeThreshold()
-
getSizeThreshold
public int getSizeThreshold()
Returns the size threshold for storing data in memory. The default value is Integer.MAX_VALUE bytes (2 GB approx).- Returns:
- the size threshold, in bytes.
- See Also:
setSizeThreshold(int)
-
-