类 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 readable String variants that accept KB or MB suffixes, for example:factory.setMaxFileSize("10MB"); factory.setMaxRequestSize("100KB");
- 从以下版本开始:
- 1.4.0
构造器概要
构造器 构造器 说明 MultipartConfigFactory()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 javax.servlet.MultipartConfigElement
createMultipartConfig()
Create a newMultipartConfigElement
instance.void
setFileSizeThreshold(int fileSizeThreshold)
Sets the size threshold in bytes after which files will be written to disk.void
setFileSizeThreshold(String fileSizeThreshold)
Sets the size 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)
Sets the maximum size in bytes allowed for uploaded files.void
setMaxFileSize(String maxFileSize)
Sets the maximum size allowed for uploaded files.void
setMaxRequestSize(long maxRequestSize)
Sets the maximum size allowed in bytes for multipart/form-data requests.void
setMaxRequestSize(String maxRequestSize)
Sets the maximum size 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(long maxFileSize)
Sets the maximum size in bytes allowed for uploaded files.- 参数:
maxFileSize
- the maximum file size- 另请参阅:
setMaxFileSize(String)
setMaxFileSize
public void setMaxFileSize(String maxFileSize)
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- 另请参阅:
setMaxFileSize(long)
setMaxRequestSize
public void setMaxRequestSize(long maxRequestSize)
Sets the maximum size allowed in bytes for multipart/form-data requests.- 参数:
maxRequestSize
- the maximum request size- 另请参阅:
setMaxRequestSize(String)
setMaxRequestSize
public void setMaxRequestSize(String maxRequestSize)
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- 另请参阅:
setMaxRequestSize(long)
setFileSizeThreshold
public void setFileSizeThreshold(int fileSizeThreshold)
Sets the size threshold in bytes after which files will be written to disk.- 参数:
fileSizeThreshold
- the file size threshold- 另请参阅:
setFileSizeThreshold(String)
setFileSizeThreshold
public void setFileSizeThreshold(String fileSizeThreshold)
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- 另请参阅:
setFileSizeThreshold(int)
createMultipartConfig
public javax.servlet.MultipartConfigElement createMultipartConfig()
Create a newMultipartConfigElement
instance.- 返回:
- the multipart config element