类 MultipartConfigFactory


  • public class MultipartConfigFactory
    extends Object
    Factory that can be used to create a MultipartConfigElement. 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
    • 方法详细资料

      • 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 new MultipartConfigElement instance.
        返回:
        the multipart config element