org.springframework.boot.context.embedded
Class MultiPartConfigFactory

java.lang.Object
  extended by 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 Summary
MultiPartConfigFactory()
           
 
Method Summary
 javax.servlet.MultipartConfigElement createMultipartConfig()
          Create a new MultipartConfigElement instance.
 void setFileSizeThreshold(int fileSizeThreshold)
          Sets the size threshold 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 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 for multipart/form-data requests.
 void setMaxRequestSize(String maxRequestSize)
          Sets the maximum size allowed for multipart/form-data requests.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 © 2013. All Rights Reserved.