@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 |
---|---|
javax.servlet.MultipartConfigElement |
createMultipartConfig()
Create a new
MultipartConfigElement using the properties. |
boolean |
getEnabled() |
org.springframework.util.unit.DataSize |
getFileSizeThreshold() |
String |
getLocation() |
org.springframework.util.unit.DataSize |
getMaxFileSize() |
org.springframework.util.unit.DataSize |
getMaxRequestSize() |
boolean |
isResolveLazily() |
void |
setEnabled(boolean enabled) |
void |
setFileSizeThreshold(org.springframework.util.unit.DataSize fileSizeThreshold) |
void |
setLocation(String location) |
void |
setMaxFileSize(org.springframework.util.unit.DataSize maxFileSize) |
void |
setMaxRequestSize(org.springframework.util.unit.DataSize maxRequestSize) |
void |
setResolveLazily(boolean resolveLazily) |
public boolean getEnabled()
public void setEnabled(boolean enabled)
public String getLocation()
public void setLocation(String location)
public org.springframework.util.unit.DataSize getMaxFileSize()
public void setMaxFileSize(org.springframework.util.unit.DataSize maxFileSize)
public org.springframework.util.unit.DataSize getMaxRequestSize()
public void setMaxRequestSize(org.springframework.util.unit.DataSize maxRequestSize)
public org.springframework.util.unit.DataSize getFileSizeThreshold()
public void setFileSizeThreshold(org.springframework.util.unit.DataSize fileSizeThreshold)
public boolean isResolveLazily()
public void setResolveLazily(boolean resolveLazily)
public javax.servlet.MultipartConfigElement createMultipartConfig()
MultipartConfigElement
using the properties.MultipartConfigElement
configured using there propertiesCopyright © 2020 Pivotal Software, Inc.. All rights reserved.