public class DefaultHttpDataFactory extends 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();
| Modifier and Type | Field and Description |
|---|---|
static long |
MAXSIZE
Proposed default MAXSIZE = -1 as UNLIMITED
|
static long |
MINSIZE
Proposed default MINSIZE as 16 KB.
|
| 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,
Charset charset) |
DefaultHttpDataFactory(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,
Charset charset) |
| Modifier and Type | Method and Description |
|---|---|
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,
String name) |
Attribute |
createAttribute(HttpRequest request,
String name,
long definedSize) |
Attribute |
createAttribute(HttpRequest request,
String name,
String value) |
FileUpload |
createFileUpload(HttpRequest request,
String name,
String filename,
String contentType,
String contentTransferEncoding,
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(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(Charset charset)
public DefaultHttpDataFactory(boolean useDisk)
public DefaultHttpDataFactory(boolean useDisk,
Charset charset)
public DefaultHttpDataFactory(long minSize)
public DefaultHttpDataFactory(long minSize,
Charset charset)
public void setBaseDir(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)
HttpDataFactorysetMaxLimit in interface HttpDataFactorypublic Attribute createAttribute(HttpRequest request, String name)
createAttribute in interface HttpDataFactoryrequest - associated requestpublic Attribute createAttribute(HttpRequest request, String name, long definedSize)
createAttribute in interface HttpDataFactoryrequest - associated requestname - name of the attributedefinedSize - defined size from request for this attributepublic Attribute createAttribute(HttpRequest request, String name, String value)
createAttribute in interface HttpDataFactoryrequest - associated requestpublic FileUpload createFileUpload(HttpRequest request, String name, String filename, String contentType, String contentTransferEncoding, 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 HttpDataFactoryCopyright © 2008–2025 The Netty Project. All rights reserved.