Class CommonsMultipartFormDataParser

java.lang.Object
com.aspectran.web.support.multipart.commons.CommonsMultipartFormDataParser
All Implemented Interfaces:
MultipartFormDataParser

public class CommonsMultipartFormDataParser extends Object implements MultipartFormDataParser
Multipart form data parser that use Apache Commons FileUpload 1.4 or above.
  • Constructor Details

    • CommonsMultipartFormDataParser

      public CommonsMultipartFormDataParser()
      Instantiates a new CommonsMultipartFormDataParser.
  • Method Details

    • getTempDirectoryPath

      public String getTempDirectoryPath()
      Description copied from interface: MultipartFormDataParser
      Returns the directory path used for temporary files.
      Specified by:
      getTempDirectoryPath in interface MultipartFormDataParser
      Returns:
      the directory path used for temporary files
    • setTempDirectoryPath

      public void setTempDirectoryPath(String tempDirectoryPath)
      Description copied from interface: MultipartFormDataParser
      Sets the directory path used to temporarily files.
      Specified by:
      setTempDirectoryPath in interface MultipartFormDataParser
      Parameters:
      tempDirectoryPath - the directory path used for temporary files
    • setMaxRequestSize

      public void setMaxRequestSize(long maxRequestSize)
      Description copied from interface: MultipartFormDataParser
      Sets the maximum length of HTTP GET Request -1 indicates no limit (the default).
      Specified by:
      setMaxRequestSize in interface MultipartFormDataParser
      Parameters:
      maxRequestSize - the maximum length of HTTP GET Request
      See Also:
      • FileUploadBase.setSizeMax(long)
    • setMaxFileSize

      public void setMaxFileSize(long maxFileSize)
      Description copied from interface: MultipartFormDataParser
      Set the maximum allowed size (in bytes) for each individual file before an upload gets rejected. -1 indicates no limit (the default).
      Specified by:
      setMaxFileSize in interface MultipartFormDataParser
      Parameters:
      maxFileSize - the maximum upload size per file
      See Also:
      • FileUploadBase.setFileSizeMax(long)
    • setMaxInMemorySize

      public void setMaxInMemorySize(int maxInMemorySize)
      Description copied from interface: MultipartFormDataParser
      Set the maximum allowed size (in bytes) before uploads are written to disk. Uploaded files will still be received past this amount, but they will not be stored in memory. Default is 10240, according to Commons FileUpload.
      Specified by:
      setMaxInMemorySize in interface MultipartFormDataParser
      Parameters:
      maxInMemorySize - the maximum in memory size allowed
      See Also:
      • DiskFileItemFactory.setSizeThreshold(int)
    • setAllowedFileExtensions

      public void setAllowedFileExtensions(String allowedFileExtensions)
      Description copied from interface: MultipartFormDataParser
      Sets the allowed file extensions.
      Specified by:
      setAllowedFileExtensions in interface MultipartFormDataParser
      Parameters:
      allowedFileExtensions - the allowed file extensions
    • setDeniedFileExtensions

      public void setDeniedFileExtensions(String deniedFileExtensions)
      Description copied from interface: MultipartFormDataParser
      Sets the denied file extensions.
      Specified by:
      setDeniedFileExtensions in interface MultipartFormDataParser
      Parameters:
      deniedFileExtensions - the denied file extensions
    • parse

      public void parse(RequestAdapter requestAdapter) throws MultipartRequestParseException
      Description copied from interface: MultipartFormDataParser
      Parse the given servlet request, resolving its multipart elements.
      Specified by:
      parse in interface MultipartFormDataParser
      Parameters:
      requestAdapter - the request adapter
      Throws:
      MultipartRequestParseException - if multipart resolution failed