Class HttpServerConfiguration.MultipartConfiguration

java.lang.Object
io.micronaut.http.server.HttpServerConfiguration.MultipartConfiguration
All Implemented Interfaces:
Toggleable
Enclosing class:
HttpServerConfiguration

@ConfigurationProperties("multipart") public static class HttpServerConfiguration.MultipartConfiguration extends Object implements Toggleable
Configuration for multipart handling.
  • Field Details

    • DEFAULT_ENABLED

      public static final boolean DEFAULT_ENABLED
      The default enable value.
      See Also:
    • DEFAULT_MAX_FILE_SIZE

      public static final long DEFAULT_MAX_FILE_SIZE
      The default max file size.
      See Also:
    • DEFAULT_DISK

      public static final boolean DEFAULT_DISK
      The default disk value.
      See Also:
    • DEFAULT_MIXED

      public static final boolean DEFAULT_MIXED
      The default mixed value.
      See Also:
    • DEFAULT_THRESHOLD

      public static final long DEFAULT_THRESHOLD
      The default threshold value.
      See Also:
  • Constructor Details

    • MultipartConfiguration

      public MultipartConfiguration()
  • Method Details

    • getLocation

      public Optional<File> getLocation()
      Returns:
      The location to store temporary files
    • getMaxFileSize

      public long getMaxFileSize()
      Returns:
      The max file size. Defaults to 1MB
    • isEnabled

      public boolean isEnabled()
      Specified by:
      isEnabled in interface Toggleable
      Returns:
      Whether file uploads are enabled. Defaults to true.
    • getEnabled

      @Internal public Optional<Boolean> getEnabled()
      The default multipart enabled setting is false for servlets, but effectively true for Netty. This method returns the value only if set by the user.
      Returns:
      The enabled setting.
    • isDisk

      public boolean isDisk()
      Returns:
      Whether to use disk. Defaults to false.
    • isMixed

      public boolean isMixed()
      Returns:
      Whether to use a mixed upload
    • getThreshold

      public long getThreshold()
      Returns:
      The threshold to trigger storage to disk
    • setLocation

      public void setLocation(File location)
      Sets the location to store files.
      Parameters:
      location - The location
    • setMaxFileSize

      public void setMaxFileSize(@ReadableBytes long maxFileSize)
      Sets the max file size. Default value (1048576L => 1MB).
      Parameters:
      maxFileSize - The max file size
    • setEnabled

      public void setEnabled(boolean enabled)
      Sets whether multipart processing is enabled. Default value (false).
      Parameters:
      enabled - True if it is enabled
    • setDisk

      public void setDisk(boolean disk)
      Sets whether to buffer data to disk or not. Default value (false).
      Parameters:
      disk - True if data should be written to disk
    • setMixed

      public void setMixed(boolean mixed)
      Sets whether to buffer data to disk if the size is greater than the threshold. Default value (false).
      Parameters:
      mixed - True if data should be written to disk after a threshold.
    • setThreshold

      public void setThreshold(@ReadableBytes long threshold)
      Sets the amount of data that should be received that will trigger the data to be stored to disk. Default value (10485760L).
      Parameters:
      threshold - The threshold