Class MultipartProperties
- java.lang.Object
- org.springframework.boot.autoconfigure.web.servlet.MultipartProperties
@ConfigurationProperties(prefix="spring.servlet.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 1MBmax-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 readableDataSizevariants.- Since:
- 1.1.0
Constructor Summary
Constructors Constructor Description MultipartProperties()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.servlet.MultipartConfigElementcreateMultipartConfig()Create a newMultipartConfigElementusing the properties.booleangetEnabled()org.springframework.util.unit.DataSizegetFileSizeThreshold()StringgetLocation()org.springframework.util.unit.DataSizegetMaxFileSize()org.springframework.util.unit.DataSizegetMaxRequestSize()booleanisResolveLazily()voidsetEnabled(boolean enabled)voidsetFileSizeThreshold(org.springframework.util.unit.DataSize fileSizeThreshold)voidsetLocation(String location)voidsetMaxFileSize(org.springframework.util.unit.DataSize maxFileSize)voidsetMaxRequestSize(org.springframework.util.unit.DataSize maxRequestSize)voidsetResolveLazily(boolean resolveLazily)
Constructor Detail
MultipartProperties
public MultipartProperties()
Method Detail
getEnabled
public boolean getEnabled()
setEnabled
public void setEnabled(boolean enabled)
getLocation
public String getLocation()
setLocation
public void setLocation(String location)
getMaxFileSize
public org.springframework.util.unit.DataSize getMaxFileSize()
setMaxFileSize
public void setMaxFileSize(org.springframework.util.unit.DataSize maxFileSize)
getMaxRequestSize
public org.springframework.util.unit.DataSize getMaxRequestSize()
setMaxRequestSize
public void setMaxRequestSize(org.springframework.util.unit.DataSize maxRequestSize)
getFileSizeThreshold
public org.springframework.util.unit.DataSize getFileSizeThreshold()
setFileSizeThreshold
public void setFileSizeThreshold(org.springframework.util.unit.DataSize fileSizeThreshold)
isResolveLazily
public boolean isResolveLazily()
setResolveLazily
public void setResolveLazily(boolean resolveLazily)
createMultipartConfig
public javax.servlet.MultipartConfigElement createMultipartConfig()
Create a newMultipartConfigElementusing the properties.- Returns:
- a new
MultipartConfigElementconfigured using there properties