类 MultipartProperties
java.lang.Object
org.springframework.boot.autoconfigure.web.servlet.MultipartProperties
@ConfigurationProperties(prefix="spring.servlet.multipart",
ignoreUnknownFields=false)
public class MultipartProperties
extends Object
Properties to be used in configuring a
MultipartConfigElement
.
location
specifies the directory where uploaded files will be stored. When not specified, a temporary directory will be used.max-file-size
specifies the maximum size permitted for uploaded files. The default is 1MBmax-request-size
specifies the maximum size allowed for multipart/form-data requests. The default is 10MB.file-size-threshold
specifies the size threshold after which files will be written to disk. The default is 0.
These properties are ultimately passed to MultipartConfigFactory
which means
you may specify numeric values using long values or using more readable
DataSize
variants.
- 从以下版本开始:
- 2.0.0
- 作者:
- Josh Long, Toshiaki Maki, Stephane Nicoll, Yanming Zhou
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明Create a newMultipartConfigElement
using the properties.boolean
boolean
boolean
void
setEnabled
(boolean enabled) void
setFileSizeThreshold
(DataSize fileSizeThreshold) void
setLocation
(String location) void
setMaxFileSize
(DataSize maxFileSize) void
setMaxRequestSize
(DataSize maxRequestSize) void
setResolveLazily
(boolean resolveLazily) void
setStrictServletCompliance
(boolean strictServletCompliance)
-
构造器详细资料
-
MultipartProperties
public MultipartProperties()
-
-
方法详细资料
-
getEnabled
public boolean getEnabled() -
setEnabled
public void setEnabled(boolean enabled) -
getLocation
-
setLocation
-
getMaxFileSize
-
setMaxFileSize
-
getMaxRequestSize
-
setMaxRequestSize
-
getFileSizeThreshold
-
setFileSizeThreshold
-
isResolveLazily
public boolean isResolveLazily() -
setResolveLazily
public void setResolveLazily(boolean resolveLazily) -
isStrictServletCompliance
public boolean isStrictServletCompliance() -
setStrictServletCompliance
public void setStrictServletCompliance(boolean strictServletCompliance) -
createMultipartConfig
Create a newMultipartConfigElement
using the properties.- 返回:
- a new
MultipartConfigElement
configured using there properties
-