类 MultipartConfig
java.lang.Object
cn.taketoday.web.multipart.MultipartConfig
Properties to be used in configuring a
MultipartConfigElement.
locationspecifies the directory where uploaded files will be stored. When not specified, a temporary directory will be used.max-file-sizespecifies the maximum size permitted for uploaded files. The default is 512MBmax-request-sizespecifies the maximum size allowed for multipart/form-data requests. The default is 1GB.file-size-thresholdspecifies the size threshold after which files will be written to disk. The default is 0.
These properties are ultimately passed to cn.taketoday.framework.web.servlet.MultipartConfigFactory which means
you may specify numeric values using long values or using more readable
DataSize variants.
- 从以下版本开始:
- 2019-07-11 22:47
- 作者:
- Harry Yang
-
字段概要
字段修饰符和类型字段说明private cn.taketoday.util.DataSizeprivate Stringtemp file upload locationprivate cn.taketoday.util.DataSizeMaximum size of a single uploaded file.private cn.taketoday.util.DataSize -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明booleancn.taketoday.util.DataSizecn.taketoday.util.DataSizecn.taketoday.util.DataSizeinthashCode()voidsetFileSizeThreshold(cn.taketoday.util.DataSize fileSizeThreshold) Sets thesizethreshold after which files will be written to disk.voidsetLocation(String location) Sets the directory location where files will be stored.voidsetMaxFileSize(cn.taketoday.util.DataSize maxFileSize) Sets the maximumsizeallowed for uploaded files.voidsetMaxRequestSize(cn.taketoday.util.DataSize maxRequestSize) Sets the maximumDataSizeallowed for multipart/form-data requests.toString()
-
字段详细资料
-
location
temp file upload location -
maxFileSize
@Nullable private cn.taketoday.util.DataSize maxFileSizeMaximum size of a single uploaded file. -
maxRequestSize
@Nullable private cn.taketoday.util.DataSize maxRequestSize -
fileSizeThreshold
@Nullable private cn.taketoday.util.DataSize fileSizeThreshold
-
-
构造器详细资料
-
MultipartConfig
public MultipartConfig()
-
-
方法详细资料
-
setFileSizeThreshold
public void setFileSizeThreshold(@Nullable cn.taketoday.util.DataSize fileSizeThreshold) Sets thesizethreshold after which files will be written to disk.- 参数:
fileSizeThreshold- the file size threshold
-
setLocation
Sets the directory location where files will be stored.- 参数:
location- the location
-
setMaxFileSize
public void setMaxFileSize(@Nullable cn.taketoday.util.DataSize maxFileSize) Sets the maximumsizeallowed for uploaded files.- 参数:
maxFileSize- the maximum file size
-
setMaxRequestSize
public void setMaxRequestSize(@Nullable cn.taketoday.util.DataSize maxRequestSize) Sets the maximumDataSizeallowed for multipart/form-data requests.- 参数:
maxRequestSize- the maximum request size
-
getLocation
-
getMaxRequestSize
@Nullable public cn.taketoday.util.DataSize getMaxRequestSize() -
getMaxFileSize
@Nullable public cn.taketoday.util.DataSize getMaxFileSize() -
getFileSizeThreshold
@Nullable public cn.taketoday.util.DataSize getFileSizeThreshold() -
toString
-
equals
-
hashCode
public int hashCode()
-