org.springframework.boot.context.embedded

Class MultiPartConfigFactory

  • java.lang.Object
    • org.springframework.boot.context.embedded.MultiPartConfigFactory


  • public class MultiPartConfigFactory
    extends Object
    Factory that can be used to create a MultipartConfigElement. Size values can be set using traditional long values or using more readable String variants that accept KB or MB suffixes, for example:
     factory.setMaxFileSize("10Mb");
     factory.setMaxRequestSize("100Kb");
     
    Author:
    Phillip Webb
    • Constructor Detail

      • MultiPartConfigFactory

        public MultiPartConfigFactory()
    • Method Detail

      • setLocation

        public void setLocation(String location)
        Sets the directory location where files will be stored.
      • setMaxFileSize

        public void setMaxFileSize(long maxFileSize)
        Sets the maximum size allowed for uploaded files.
        See Also:
        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.
        See Also:
        setMaxFileSize(long)
      • setMaxRequestSize

        public void setMaxRequestSize(long maxRequestSize)
        Sets the maximum size allowed for multipart/form-data requests.
        See Also:
        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.
        See Also:
        setMaxRequestSize(long)
      • setFileSizeThreshold

        public void setFileSizeThreshold(int fileSizeThreshold)
        Sets the size threshold after which files will be written to disk.
        See Also:
        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.
        See Also:
        setFileSizeThreshold(int)
      • createMultipartConfig

        public javax.servlet.MultipartConfigElement createMultipartConfig()
        Create a new MultipartConfigElement instance.

Copyright © 2014 Pivotal Software, Inc.. All rights reserved.