Class MultipartConfigFactory
java.lang.Object
org.springframework.boot.servlet.MultipartConfigFactory
Factory that can be used to create a
MultipartConfigElement.- Since:
- 4.0.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjakarta.servlet.MultipartConfigElementCreate a newMultipartConfigElementinstance.voidsetFileSizeThreshold(@Nullable org.springframework.util.unit.DataSize fileSizeThreshold) Sets thesizethreshold after which files will be written to disk.voidsetLocation(@Nullable String location) Sets the directory location where files will be stored.voidsetMaxFileSize(@Nullable org.springframework.util.unit.DataSize maxFileSize) Sets the maximumsizeallowed for uploaded files.voidsetMaxRequestSize(@Nullable org.springframework.util.unit.DataSize maxRequestSize) Sets the maximumDataSizeallowed for multipart/form-data requests.
-
Constructor Details
-
MultipartConfigFactory
public MultipartConfigFactory()
-
-
Method Details
-
setLocation
Sets the directory location where files will be stored.- Parameters:
location- the location
-
setMaxFileSize
public void setMaxFileSize(@Nullable org.springframework.util.unit.DataSize maxFileSize) Sets the maximumsizeallowed for uploaded files.- Parameters:
maxFileSize- the maximum file size
-
setMaxRequestSize
public void setMaxRequestSize(@Nullable org.springframework.util.unit.DataSize maxRequestSize) Sets the maximumDataSizeallowed for multipart/form-data requests.- Parameters:
maxRequestSize- the maximum request size
-
setFileSizeThreshold
public void setFileSizeThreshold(@Nullable org.springframework.util.unit.DataSize fileSizeThreshold) Sets thesizethreshold after which files will be written to disk.- Parameters:
fileSizeThreshold- the file size threshold
-
createMultipartConfig
public jakarta.servlet.MultipartConfigElement createMultipartConfig()Create a newMultipartConfigElementinstance.- Returns:
- the multipart config element
-