Class MultipartConfigFactory
- java.lang.Object
- org.springframework.boot.web.servlet.MultipartConfigFactory
public class MultipartConfigFactory extends Object
Factory that can be used to create aMultipartConfigElement
. Size values can be set using traditional long values which are set in bytes or using more convenientDataSize
variants.- Since:
- 1.4.0
Constructor Summary
Constructors Constructor Description MultipartConfigFactory()
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description javax.servlet.MultipartConfigElement
createMultipartConfig()
Create a newMultipartConfigElement
instance.void
setFileSizeThreshold(int fileSizeThreshold)
Deprecated.since 2.1.0 in favor ofsetFileSizeThreshold(DataSize)
void
setFileSizeThreshold(String fileSizeThreshold)
Deprecated.since 2.1.0 in favor ofsetFileSizeThreshold(DataSize)
void
setFileSizeThreshold(org.springframework.util.unit.DataSize fileSizeThreshold)
Sets thesize
threshold after which files will be written to disk.void
setLocation(String location)
Sets the directory location where files will be stored.void
setMaxFileSize(long maxFileSize)
Deprecated.since 2.1.0 in favor ofsetMaxFileSize(DataSize)
void
setMaxFileSize(String maxFileSize)
Deprecated.since 2.1.0 in favor ofsetMaxFileSize(DataSize)
void
setMaxFileSize(org.springframework.util.unit.DataSize maxFileSize)
Sets the maximumsize
allowed for uploaded files.void
setMaxRequestSize(long maxRequestSize)
Deprecated.since 2.1.0 in favor ofsetMaxRequestSize(DataSize)
void
setMaxRequestSize(String maxRequestSize)
Deprecated.since 2.1.0 in favor ofsetMaxRequestSize(DataSize)
void
setMaxRequestSize(org.springframework.util.unit.DataSize maxRequestSize)
Sets the maximumDataSize
allowed for multipart/form-data requests.
Constructor Detail
MultipartConfigFactory
public MultipartConfigFactory()
Method Detail
setLocation
public void setLocation(String location)
Sets the directory location where files will be stored.- Parameters:
location
- the location
setMaxFileSize
public void setMaxFileSize(org.springframework.util.unit.DataSize maxFileSize)
Sets the maximumsize
allowed for uploaded files.- Parameters:
maxFileSize
- the maximum file size
setMaxFileSize
@Deprecated public void setMaxFileSize(long maxFileSize)
Deprecated.since 2.1.0 in favor ofsetMaxFileSize(DataSize)
Sets the maximum size in bytes allowed for uploaded files.- Parameters:
maxFileSize
- the maximum file size
setMaxFileSize
@Deprecated public void setMaxFileSize(String maxFileSize)
Deprecated.since 2.1.0 in favor ofsetMaxFileSize(DataSize)
Sets the maximum size allowed for uploaded files. Values can use the suffixed "MB" or "KB" to indicate a Megabyte or Kilobyte size.- Parameters:
maxFileSize
- the maximum file size
setMaxRequestSize
public void setMaxRequestSize(org.springframework.util.unit.DataSize maxRequestSize)
Sets the maximumDataSize
allowed for multipart/form-data requests.- Parameters:
maxRequestSize
- the maximum request size
setMaxRequestSize
@Deprecated public void setMaxRequestSize(long maxRequestSize)
Deprecated.since 2.1.0 in favor ofsetMaxRequestSize(DataSize)
Sets the maximum size allowed in bytes for multipart/form-data requests.- Parameters:
maxRequestSize
- the maximum request size
setMaxRequestSize
@Deprecated public void setMaxRequestSize(String maxRequestSize)
Deprecated.since 2.1.0 in favor ofsetMaxRequestSize(DataSize)
Sets the maximum size allowed for multipart/form-data requests. Values can use the suffixed "MB" or "KB" to indicate a Megabyte or Kilobyte size.- Parameters:
maxRequestSize
- the maximum request size
setFileSizeThreshold
public void setFileSizeThreshold(org.springframework.util.unit.DataSize fileSizeThreshold)
Sets thesize
threshold after which files will be written to disk.- Parameters:
fileSizeThreshold
- the file size threshold
setFileSizeThreshold
@Deprecated public void setFileSizeThreshold(int fileSizeThreshold)
Deprecated.since 2.1.0 in favor ofsetFileSizeThreshold(DataSize)
Sets the size threshold in bytes after which files will be written to disk.- Parameters:
fileSizeThreshold
- the file size threshold
setFileSizeThreshold
@Deprecated public void setFileSizeThreshold(String fileSizeThreshold)
Deprecated.since 2.1.0 in favor ofsetFileSizeThreshold(DataSize)
Sets the size threshold after which files will be written to disk. Values can use the suffixed "MB" or "KB" to indicate a Megabyte or Kilobyte size.- Parameters:
fileSizeThreshold
- the file size threshold
createMultipartConfig
public javax.servlet.MultipartConfigElement createMultipartConfig()
Create a newMultipartConfigElement
instance.- Returns:
- the multipart config element