public class UploadParameters extends Object implements UploadConfiguration
FILE_SIZE_MAX_DEFAULT, SIZE_MAX_DEFAULT, SIZE_THRESHOLD_DEFAULT| Constructor and Description |
|---|
UploadParameters() |
| Modifier and Type | Method and Description |
|---|---|
void |
applyDefaultValues()
设置默认值。
|
boolean |
equals(Object obj) |
String[] |
getFileNameKey()
标准的上传文件请求中,包含这样的内容:
Content-Disposition: attachment; filename=xxx.txt
。然而有些不规范的应用,会取fname=xxx.txt。此变量为兼容这种情况而设。 |
HumanReadableSize |
getFileSizeMax()
取得单个文件允许的最大尺寸,超过此尺寸的文件将被抛弃。单位:字节,值
-1表示没有限制。 |
String |
getItemStorageBeanName() |
File |
getRepository()
取得暂存文件的目录。
|
HumanReadableSize |
getSizeMax()
取得HTTP请求的最大尺寸,超过此尺寸的请求将被抛弃。单位:字节,值
-1表示没有限制。 |
HumanReadableSize |
getSizeThreshold()
取得将文件放在内存中的阈值,小于此值的文件被保存在内存中。单位:字节。
|
int |
hashCode() |
boolean |
isDiskItemFactory() |
boolean |
isKeepFormFieldInMemory()
是否将普通的form field保持在内存里?当
sizeThreshold值为0
的时候,该值自动为true。 |
boolean |
isSaveInFile() |
boolean |
isTemporary()
是否是临时目录,true:认为是临时文件,请求完毕会删除此临时文件。
|
void |
setDiskItemFactory(boolean diskItemFactory) |
void |
setFileNameKey(String[] fileNameKey) |
void |
setFileSizeMax(HumanReadableSize fileSizeMax) |
void |
setFileSizeMax(long fileSizeMax) |
void |
setItemStorageBeanName(String itemStorageBeanName) |
void |
setKeepFormFieldInMemory(boolean keepFormFieldInMemory) |
void |
setRepository(File repository) |
void |
setSaveInFile(boolean saveInFile) |
void |
setSizeMax(HumanReadableSize sizeMax) |
void |
setSizeMax(long sizeMax) |
void |
setSizeThreshold(HumanReadableSize sizeThreshold) |
void |
setSizeThreshold(int sizeThreshold) |
void |
setTemporary(boolean isTemporary) |
String |
toString() |
public boolean isDiskItemFactory()
isDiskItemFactory in interface UploadConfigurationpublic void setDiskItemFactory(boolean diskItemFactory)
public String getItemStorageBeanName()
getItemStorageBeanName in interface UploadConfigurationpublic void setItemStorageBeanName(String itemStorageBeanName)
public File getRepository()
UploadConfigurationgetRepository in interface UploadConfigurationpublic void setRepository(File repository)
public HumanReadableSize getSizeMax()
UploadConfiguration-1表示没有限制。getSizeMax in interface UploadConfigurationpublic void setSizeMax(HumanReadableSize sizeMax)
public void setSizeMax(long sizeMax)
public HumanReadableSize getFileSizeMax()
UploadConfiguration-1表示没有限制。getFileSizeMax in interface UploadConfigurationpublic void setFileSizeMax(HumanReadableSize fileSizeMax)
public void setFileSizeMax(long fileSizeMax)
public HumanReadableSize getSizeThreshold()
UploadConfigurationgetSizeThreshold in interface UploadConfigurationpublic void setSizeThreshold(HumanReadableSize sizeThreshold)
public void setSizeThreshold(int sizeThreshold)
public boolean isKeepFormFieldInMemory()
UploadConfigurationsizeThreshold值为0
的时候,该值自动为true。isKeepFormFieldInMemory in interface UploadConfigurationpublic void setKeepFormFieldInMemory(boolean keepFormFieldInMemory)
public boolean isSaveInFile()
isSaveInFile in interface UploadConfigurationpublic void setSaveInFile(boolean saveInFile)
public String[] getFileNameKey()
UploadConfigurationContent-Disposition: attachment; filename=xxx.txt
。然而有些不规范的应用,会取fname=xxx.txt。此变量为兼容这种情况而设。getFileNameKey in interface UploadConfigurationpublic void setFileNameKey(String[] fileNameKey)
public void applyDefaultValues()
public boolean isTemporary()
UploadConfigurationisTemporary in interface UploadConfigurationpublic void setTemporary(boolean isTemporary)
Copyright © 2006–2018 TinyGroup. All rights reserved.