类 MultipartProperties
- java.lang.Object
- org.springframework.boot.autoconfigure.web.MultipartProperties
@ConfigurationProperties(prefix="spring.http.multipart", ignoreUnknownFields=false) public class MultipartProperties extends ObjectProperties to be used in configuring aMultipartConfigElement.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 1MB.max-request-sizespecifies the maximum size allowed for multipart/form-data requests. The default is 10MB.file-size-thresholdspecifies the size threshold after which files will be written to disk. The default is 0.
These properties are ultimately passed to
MultipartConfigFactorywhich means you may specify numeric values using long values or using more readable String variants that accept KB or MB suffixes.- 从以下版本开始:
- 1.1.0
构造器概要
构造器 构造器 说明 MultipartProperties()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 javax.servlet.MultipartConfigElementcreateMultipartConfig()Create a newMultipartConfigElementusing the properties.booleangetEnabled()StringgetFileSizeThreshold()StringgetLocation()StringgetMaxFileSize()StringgetMaxRequestSize()booleanisResolveLazily()voidsetEnabled(boolean enabled)voidsetFileSizeThreshold(String fileSizeThreshold)voidsetLocation(String location)voidsetMaxFileSize(String maxFileSize)voidsetMaxRequestSize(String maxRequestSize)voidsetResolveLazily(boolean resolveLazily)
构造器详细资料
MultipartProperties
public MultipartProperties()
方法详细资料
getEnabled
public boolean getEnabled()
setEnabled
public void setEnabled(boolean enabled)
getLocation
public String getLocation()
setLocation
public void setLocation(String location)
getMaxFileSize
public String getMaxFileSize()
setMaxFileSize
public void setMaxFileSize(String maxFileSize)
getMaxRequestSize
public String getMaxRequestSize()
setMaxRequestSize
public void setMaxRequestSize(String maxRequestSize)
getFileSizeThreshold
public String getFileSizeThreshold()
setFileSizeThreshold
public void setFileSizeThreshold(String fileSizeThreshold)
isResolveLazily
public boolean isResolveLazily()
setResolveLazily
public void setResolveLazily(boolean resolveLazily)
createMultipartConfig
public javax.servlet.MultipartConfigElement createMultipartConfig()
Create a newMultipartConfigElementusing the properties.- 返回:
- a new
MultipartConfigElementconfigured using there properties