public class DefaultHttpDataFactory extends java.lang.Object implements HttpDataFactory
Attribute
和FileUpload
。
根据构造函数, Attribute
和FileUpload
可以是:
Modifier and Type | Field and Description |
---|---|
static long |
MAXSIZE
建议默认MAXSIZE = -1为无限制
|
static long |
MINSIZE
建议的默认MINSIZE为16 KB。
|
Constructor and Description |
---|
DefaultHttpDataFactory()
如果缺省大小(16KB),HttpData将在内存中。
|
DefaultHttpDataFactory(boolean useDisk)
如果useDisk为True,则HttpData将永远在磁盘上;否则,如果为False,则始终在Memory中
|
DefaultHttpDataFactory(boolean useDisk, java.nio.charset.Charset charset) |
DefaultHttpDataFactory(java.nio.charset.Charset charset) |
DefaultHttpDataFactory(long minSize)
如果文件大小大于minSize,则HttpData将位于磁盘上,否则它将位于内存中。
|
DefaultHttpDataFactory(long minSize, java.nio.charset.Charset charset) |
Modifier and Type | Method and Description |
---|---|
void |
cleanAllHttpData()
为所有请求从清理列表中删除虚拟文件存储中的所有InterfaceHttpData
|
void |
cleanAllHttpDatas() |
void |
cleanRequestHttpData(HttpRequest request)
从请求的清除列表中删除虚拟文件存储中的所有InterfaceHttpData
|
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)
从干净的列表中删除给定的InterfaceHttpData(不会删除该文件,除非该文件在构建时仍是临时文件)
|
void |
setMaxLimit(long maxSize)
在字段上设置最大大小限制。
|
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 setMaxLimit(long maxSize)
HttpDataFactory
setMaxLimit
在界面
HttpDataFactory
public Attribute createAttribute(HttpRequest request, java.lang.String name)
createAttribute
,界面
HttpDataFactory
request
- 相关请求
public Attribute createAttribute(HttpRequest request, java.lang.String name, long definedSize)
createAttribute
,界面
HttpDataFactory
request
- 相关请求
name
- 属性的名称
definedSize
- 根据该属性的请求定义大小
public Attribute createAttribute(HttpRequest request, java.lang.String name, java.lang.String value)
createAttribute
接口
HttpDataFactory
request
- 相关请求
public 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
- 相关请求
size
- 上传文件的大小
public void removeHttpDataFromClean(HttpRequest request, InterfaceHttpData data)
HttpDataFactory
removeHttpDataFromClean
接口
HttpDataFactory
request
- 相关请求
public void cleanRequestHttpData(HttpRequest request)
HttpDataFactory
cleanRequestHttpData
接口
HttpDataFactory
request
- 相关请求
public void cleanAllHttpData()
HttpDataFactory
cleanAllHttpData
在界面
HttpDataFactory
public void cleanRequestHttpDatas(HttpRequest request)
cleanRequestHttpDatas
在界面
HttpDataFactory
public void cleanAllHttpDatas()
cleanAllHttpDatas
in interface
HttpDataFactory
Copyright © 2008–2018 The Netty Project. All rights reserved.