@ConfigurationProperties(prefix="spring.servlet.multipart", ignoreUnknownFields=false) public class MultipartProperties extends Object
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.
| Constructor and Description |
|---|
MultipartProperties() |
| Modifier and Type | Method and Description |
|---|---|
MultipartConfigElement |
createMultipartConfig()
Create a new
MultipartConfigElement using the properties. |
boolean |
getEnabled() |
DataSize |
getFileSizeThreshold() |
String |
getLocation() |
DataSize |
getMaxFileSize() |
DataSize |
getMaxRequestSize() |
boolean |
isResolveLazily() |
void |
setEnabled(boolean enabled) |
void |
setFileSizeThreshold(DataSize fileSizeThreshold) |
void |
setLocation(String location) |
void |
setMaxFileSize(DataSize maxFileSize) |
void |
setMaxRequestSize(DataSize maxRequestSize) |
void |
setResolveLazily(boolean resolveLazily) |
public boolean getEnabled()
public void setEnabled(boolean enabled)
public String getLocation()
public void setLocation(String location)
public DataSize getMaxFileSize()
public void setMaxFileSize(DataSize maxFileSize)
public DataSize getMaxRequestSize()
public void setMaxRequestSize(DataSize maxRequestSize)
public DataSize getFileSizeThreshold()
public void setFileSizeThreshold(DataSize fileSizeThreshold)
public boolean isResolveLazily()
public void setResolveLazily(boolean resolveLazily)
public MultipartConfigElement createMultipartConfig()
MultipartConfigElement using the properties.MultipartConfigElement configured using there properties