Class MultipartConfiguration

java.lang.Object
io.fusionauth.http.io.MultipartConfiguration

public class MultipartConfiguration extends Object
Provides configuration to control the behavior of the MultipartStream parser, specifically around file uploads.
Author:
Daniel DeGroff
  • Constructor Details

    • MultipartConfiguration

      public MultipartConfiguration()
    • MultipartConfiguration

      public MultipartConfiguration(MultipartConfiguration other)
  • Method Details

    • deleteTemporaryFiles

      public boolean deleteTemporaryFiles()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • getFileUploadPolicy

      public MultipartFileUploadPolicy getFileUploadPolicy()
    • getMaxFileSize

      public long getMaxFileSize()
    • getMaxRequestSize

      public long getMaxRequestSize()
    • getMultipartBufferSize

      public int getMultipartBufferSize()
    • getTemporaryFileLocation

      public String getTemporaryFileLocation()
    • getTemporaryFilenamePrefix

      public String getTemporaryFilenamePrefix()
    • getTemporaryFilenameSuffix

      public String getTemporaryFilenameSuffix()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • isDeleteTemporaryFiles

      public boolean isDeleteTemporaryFiles()
    • withDeleteTemporaryFiles

      public MultipartConfiguration withDeleteTemporaryFiles(boolean deleteTemporaryFiles)
      Setting this to true will cause the server to delete all temporary files created while processing a multipart stream after the request handler has been invoked.

      If you set this to false the request handler will need to manage cleanup of these temporary files.

      Parameters:
      deleteTemporaryFiles - controls if temporary files are deleted by the server.
      Returns:
      This.
    • withFileUploadPolicy

      public MultipartConfiguration withFileUploadPolicy(MultipartFileUploadPolicy fileUploadPolicy)
      This is the file upload policy for the HTTP server.
      Parameters:
      fileUploadPolicy - the file upload policy. Cannot be null.
      Returns:
      This.
    • withMaxFileSize

      public MultipartConfiguration withMaxFileSize(long maxFileSize)
      This is the maximum size for each file found within a multipart stream which may contain one to many files.
      Parameters:
      maxFileSize - the maximum file size in bytes
      Returns:
      This.
    • withMaxRequestSize

      public MultipartConfiguration withMaxRequestSize(long maxRequestSize)
      This is the maximum size of the request payload in bytes when reading a multipart stream.
      Parameters:
      maxRequestSize - the maximum request size in bytes
      Returns:
      This.
    • withMultipartBufferSize

      public MultipartConfiguration withMultipartBufferSize(int multipartBufferSize)
      Parameters:
      multipartBufferSize - the size of the buffer used to parse a multipart stream.
      Returns:
      This.
    • withTemporaryFileLocation

      public MultipartConfiguration withTemporaryFileLocation(String temporaryFileLocation)
      A temporary file location used for creating temporary files.

      The specific behavior of creating temporary files will be dependant upon the MultipartFileManager implementation.

      Parameters:
      temporaryFileLocation - the temporary file location. Cannot be null.
      Returns:
      This.
    • withTemporaryFilenamePrefix

      public MultipartConfiguration withTemporaryFilenamePrefix(String temporaryFilenamePrefix)
      An optional filename prefix used for naming temporary files.

      This parameter may be set to null. When set to null a system default such as '.tmp' may be used when naming a temporary file depending upon the MultipartFileManager implementation.

      Parameters:
      temporaryFilenamePrefix - an optional filename prefix to be used when creating temporary files.
      Returns:
      This.
    • withTemporaryFilenameSuffix

      public MultipartConfiguration withTemporaryFilenameSuffix(String temporaryFilenameSuffix)
      An optional filename suffix used for naming temporary files.

      This parameter may be set to null. The specific file naming with or without this optional suffix may be dependant upon the MultipartFileManager implementation. file depending upon the MultipartFileManager implementation.

      Parameters:
      temporaryFilenameSuffix - an optional filename suffix to be used when creating temporary files.
      Returns:
      This.