Class AdaptiveFileUploadFactory

java.lang.Object
jodd.http.upload.impl.AdaptiveFileUploadFactory
All Implemented Interfaces:
FileUploadFactory

public class AdaptiveFileUploadFactory extends Object implements FileUploadFactory
Factory for AdaptiveFileUpload.
  • Field Details

    • memoryThreshold

      protected int memoryThreshold
    • uploadPath

      protected File uploadPath
    • maxFileSize

      protected int maxFileSize
    • breakOnError

      protected boolean breakOnError
    • fileExtensions

      protected String[] fileExtensions
    • allowFileExtensions

      protected boolean allowFileExtensions
  • Constructor Details

    • AdaptiveFileUploadFactory

      public AdaptiveFileUploadFactory()
  • Method Details

    • create

      public FileUpload create(MultipartRequestInputStream input)
      Creates new instance of uploaded file.
      Specified by:
      create in interface FileUploadFactory
    • getMemoryThreshold

      public int getMemoryThreshold()
    • setMemoryThreshold

      public AdaptiveFileUploadFactory setMemoryThreshold(int memoryThreshold)
      Specifies per file memory limit for keeping uploaded files in the memory.
    • getUploadPath

      public File getUploadPath()
    • setUploadPath

      public AdaptiveFileUploadFactory setUploadPath(File uploadPath)
      Specifies the upload path. If set to null default system TEMP path will be used.
    • getMaxFileSize

      public int getMaxFileSize()
    • setMaxFileSize

      public AdaptiveFileUploadFactory setMaxFileSize(int maxFileSize)
      Sets maximum file upload size. Setting to -1 disables this constraint.
    • isBreakOnError

      public boolean isBreakOnError()
    • setBreakOnError

      public AdaptiveFileUploadFactory setBreakOnError(boolean breakOnError)
    • breakOnError

      public AdaptiveFileUploadFactory breakOnError(boolean breakOnError)
      Specifies if upload should break on error.
    • setFileExtensions

      public AdaptiveFileUploadFactory setFileExtensions(String[] fileExtensions, boolean allow)
      Allow or disallow set of file extensions. Only one rule can be active at time, which means user can only specify extensions that are either allowed or disallowed. Setting this value to null will turn this feature off.