public class DefaultHttpDataFactory extends java.lang.Object implements HttpDataFactory
Attribute
and FileUpload
according to constructor.
According to the constructor, Attribute
and FileUpload
can be:
for (InterfaceHttpData httpData: decoder.getBodyHttpDatas()) {
httpData.release();
factory.removeHttpDataFromClean(request, httpData);
}
factory.cleanAllHttpData();
decoder.destroy();
限定符和类型 | 字段和说明 |
---|---|
static long |
MAXSIZE
Proposed default MAXSIZE = -1 as UNLIMITED
|
static long |
MINSIZE
Proposed default MINSIZE as 16 KB.
|
构造器和说明 |
---|
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) |
限定符和类型 | 方法和说明 |
---|---|
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) |
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 |
setBaseDir(java.lang.String baseDir)
Override global
DiskAttribute.baseDirectory and DiskFileUpload.baseDirectory values. |
void |
setDeleteOnExit(boolean deleteOnExit)
Override global
DiskAttribute.deleteOnExitTemporaryFile and
DiskFileUpload.deleteOnExitTemporaryFile values. |
void |
setMaxLimit(long maxSize)
To set a max size limitation on fields.
|
public static final long MINSIZE
public static final long MAXSIZE
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 setBaseDir(java.lang.String baseDir)
DiskAttribute.baseDirectory
and DiskFileUpload.baseDirectory
values.baseDir
- directory path where to store disk attributes and file uploads.public void setDeleteOnExit(boolean deleteOnExit)
DiskAttribute.deleteOnExitTemporaryFile
and
DiskFileUpload.deleteOnExitTemporaryFile
values.deleteOnExit
- true if temporary files should be deleted with the JVM, false otherwise.public void setMaxLimit(long maxSize)
HttpDataFactory
setMaxLimit
在接口中 HttpDataFactory
public Attribute createAttribute(HttpRequest request, java.lang.String name)
createAttribute
在接口中 HttpDataFactory
request
- associated requestpublic Attribute createAttribute(HttpRequest request, java.lang.String name, long definedSize)
createAttribute
在接口中 HttpDataFactory
request
- associated requestname
- name of the attributedefinedSize
- defined size from request for this attributepublic Attribute createAttribute(HttpRequest request, java.lang.String name, java.lang.String value)
createAttribute
在接口中 HttpDataFactory
request
- 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
在接口中 HttpDataFactory
request
- associated requestsize
- the size of the Uploaded filepublic void removeHttpDataFromClean(HttpRequest request, InterfaceHttpData data)
HttpDataFactory
removeHttpDataFromClean
在接口中 HttpDataFactory
request
- associated requestpublic void cleanRequestHttpData(HttpRequest request)
HttpDataFactory
cleanRequestHttpData
在接口中 HttpDataFactory
request
- associated requestpublic void cleanAllHttpData()
HttpDataFactory
cleanAllHttpData
在接口中 HttpDataFactory
public void cleanRequestHttpDatas(HttpRequest request)
cleanRequestHttpDatas
在接口中 HttpDataFactory
public void cleanAllHttpDatas()
cleanAllHttpDatas
在接口中 HttpDataFactory