类 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.- 从以下版本开始:
- 1.4.0
构造器概要
构造器 构造器 说明 MultipartConfigFactory()
方法概要
所有方法 实例方法 具体方法 已过时的方法 修饰符和类型 方法 说明 javax.servlet.MultipartConfigElement
createMultipartConfig()
Create a newMultipartConfigElement
instance.void
setFileSizeThreshold(int fileSizeThreshold)
已过时。since 2.1.0 in favor ofsetFileSizeThreshold(DataSize)
void
setFileSizeThreshold(String fileSizeThreshold)
已过时。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)
已过时。since 2.1.0 in favor ofsetMaxFileSize(DataSize)
void
setMaxFileSize(String maxFileSize)
已过时。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)
已过时。since 2.1.0 in favor ofsetMaxRequestSize(DataSize)
void
setMaxRequestSize(String maxRequestSize)
已过时。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.
构造器详细资料
MultipartConfigFactory
public MultipartConfigFactory()
方法详细资料
setLocation
public void setLocation(String location)
Sets the directory location where files will be stored.- 参数:
location
- the location
setMaxFileSize
public void setMaxFileSize(org.springframework.util.unit.DataSize maxFileSize)
Sets the maximumsize
allowed for uploaded files.- 参数:
maxFileSize
- the maximum file size
setMaxFileSize
@Deprecated public void setMaxFileSize(long maxFileSize)
已过时。since 2.1.0 in favor ofsetMaxFileSize(DataSize)
Sets the maximum size in bytes allowed for uploaded files.- 参数:
maxFileSize
- the maximum file size
setMaxFileSize
@Deprecated public void setMaxFileSize(String maxFileSize)
已过时。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.- 参数:
maxFileSize
- the maximum file size
setMaxRequestSize
public void setMaxRequestSize(org.springframework.util.unit.DataSize maxRequestSize)
Sets the maximumDataSize
allowed for multipart/form-data requests.- 参数:
maxRequestSize
- the maximum request size
setMaxRequestSize
@Deprecated public void setMaxRequestSize(long maxRequestSize)
已过时。since 2.1.0 in favor ofsetMaxRequestSize(DataSize)
Sets the maximum size allowed in bytes for multipart/form-data requests.- 参数:
maxRequestSize
- the maximum request size
setMaxRequestSize
@Deprecated public void setMaxRequestSize(String maxRequestSize)
已过时。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.- 参数:
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.- 参数:
fileSizeThreshold
- the file size threshold
setFileSizeThreshold
@Deprecated public void setFileSizeThreshold(int fileSizeThreshold)
已过时。since 2.1.0 in favor ofsetFileSizeThreshold(DataSize)
Sets the size threshold in bytes after which files will be written to disk.- 参数:
fileSizeThreshold
- the file size threshold
setFileSizeThreshold
@Deprecated public void setFileSizeThreshold(String fileSizeThreshold)
已过时。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.- 参数:
fileSizeThreshold
- the file size threshold
createMultipartConfig
public javax.servlet.MultipartConfigElement createMultipartConfig()
Create a newMultipartConfigElement
instance.- 返回:
- the multipart config element