public class DefaultHttpDataFactory extends java.lang.Object implements HttpDataFactory
| Modifier and Type | Field and Description |
|---|---|
private java.nio.charset.Charset |
charset |
private boolean |
checkSize |
private long |
maxSize |
static long |
MAXSIZE
Proposed default MAXSIZE = -1 as UNLIMITED
|
private long |
minSize |
static long |
MINSIZE
Proposed default MINSIZE as 16 KB.
|
private java.util.Map<HttpRequest,java.util.List<HttpData>> |
requestFileDeleteMap
Keep all HttpDatas until cleanAllHttpData() is called.
|
private boolean |
useDisk |
| Constructor and Description |
|---|
DefaultHttpDataFactory()
HttpData will be in memory if less than default size (16KB).
|
DefaultHttpDataFactory(boolean useDisk)
HttpData will be always on Disk if useDisk is True, else always in Memory if False
|
DefaultHttpDataFactory(boolean useDisk,
java.nio.charset.Charset charset) |
DefaultHttpDataFactory(java.nio.charset.Charset charset) |
DefaultHttpDataFactory(long minSize)
HttpData will be on Disk if the size of the file is greater than minSize, else it
will be in memory.
|
DefaultHttpDataFactory(long minSize,
java.nio.charset.Charset charset) |
| Modifier and Type | Method and Description |
|---|---|
private static void |
checkHttpDataSize(HttpData data)
Utility method
|
void |
cleanAllHttpData()
Remove all InterfaceHttpData from virtual File storage from clean list for all requests
|
void |
cleanAllHttpDatas() |
void |
cleanRequestHttpData(HttpRequest request)
Remove all InterfaceHttpData from virtual File storage from clean list for the request
|
void |
cleanRequestHttpDatas(HttpRequest request) |
Attribute |
createAttribute(HttpRequest request,
java.lang.String name) |
Attribute |
createAttribute(HttpRequest request,
java.lang.String name,
long definedSize) |
Attribute |
createAttribute(HttpRequest request,
java.lang.String name,
java.lang.String value) |
FileUpload |
createFileUpload(HttpRequest request,
java.lang.String name,
java.lang.String filename,
java.lang.String contentType,
java.lang.String contentTransferEncoding,
java.nio.charset.Charset charset,
long size) |
private java.util.List<HttpData> |
getList(HttpRequest request) |
void |
removeHttpDataFromClean(HttpRequest request,
InterfaceHttpData data)
Remove the given InterfaceHttpData from clean list (will not delete the file, except if the file
is still a temporary one as setup at construction)
|
void |
setMaxLimit(long maxSize)
To set a max size limitation on fields.
|
public static final long MINSIZE
public static final long MAXSIZE
private final boolean useDisk
private final boolean checkSize
private long minSize
private long maxSize
private java.nio.charset.Charset charset
private final java.util.Map<HttpRequest,java.util.List<HttpData>> requestFileDeleteMap
public DefaultHttpDataFactory()
public DefaultHttpDataFactory(java.nio.charset.Charset charset)
public DefaultHttpDataFactory(boolean useDisk)
public DefaultHttpDataFactory(boolean useDisk,
java.nio.charset.Charset charset)
public DefaultHttpDataFactory(long minSize)
public DefaultHttpDataFactory(long minSize,
java.nio.charset.Charset charset)
public void setMaxLimit(long maxSize)
HttpDataFactorysetMaxLimit in interface HttpDataFactoryprivate java.util.List<HttpData> getList(HttpRequest request)
public Attribute createAttribute(HttpRequest request, java.lang.String name)
createAttribute in interface HttpDataFactoryrequest - associated requestpublic Attribute createAttribute(HttpRequest request, java.lang.String name, long definedSize)
createAttribute in interface HttpDataFactoryrequest - associated requestname - name of the attributedefinedSize - defined size from request for this attributeprivate static void checkHttpDataSize(HttpData data)
public Attribute createAttribute(HttpRequest request, java.lang.String name, java.lang.String value)
createAttribute in interface HttpDataFactoryrequest - associated requestpublic FileUpload createFileUpload(HttpRequest request, java.lang.String name, java.lang.String filename, java.lang.String contentType, java.lang.String contentTransferEncoding, java.nio.charset.Charset charset, long size)
createFileUpload in interface HttpDataFactoryrequest - associated requestsize - the size of the Uploaded filepublic void removeHttpDataFromClean(HttpRequest request, InterfaceHttpData data)
HttpDataFactoryremoveHttpDataFromClean in interface HttpDataFactoryrequest - associated requestpublic void cleanRequestHttpData(HttpRequest request)
HttpDataFactorycleanRequestHttpData in interface HttpDataFactoryrequest - associated requestpublic void cleanAllHttpData()
HttpDataFactorycleanAllHttpData in interface HttpDataFactorypublic void cleanRequestHttpDatas(HttpRequest request)
cleanRequestHttpDatas in interface HttpDataFactorypublic void cleanAllHttpDatas()
cleanAllHttpDatas in interface HttpDataFactory