Package io.micronaut.http.server
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 SummaryFieldsModifier and TypeFieldDescriptionstatic final booleanThe default disk value.static final booleanThe default enable value.static final longThe default max file size.static final booleanThe default mixed value.static final longThe default threshold value.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionThe default multipart enabled setting is false for servlets, but effectively true for Netty.longlongbooleanisDisk()booleanbooleanisMixed()voidsetDisk(boolean disk) Sets whether to buffer data to disk or not.voidsetEnabled(boolean enabled) Sets whether multipart processing is enabled.voidsetLocation(File location) Sets the location to store files.voidsetMaxFileSize(long maxFileSize) Sets the max file size.voidsetMixed(boolean mixed) Sets whether to buffer data to disk if the size is greater than the threshold.voidsetThreshold(long threshold) Sets the amount of data that should be received that will trigger the data to be stored to disk.
- 
Field Details- 
DEFAULT_ENABLEDpublic static final boolean DEFAULT_ENABLEDThe default enable value.- See Also:
 
- 
DEFAULT_MAX_FILE_SIZEpublic static final long DEFAULT_MAX_FILE_SIZEThe default max file size.- See Also:
 
- 
DEFAULT_DISKpublic static final boolean DEFAULT_DISKThe default disk value.- See Also:
 
- 
DEFAULT_MIXEDpublic static final boolean DEFAULT_MIXEDThe default mixed value.- See Also:
 
- 
DEFAULT_THRESHOLDpublic static final long DEFAULT_THRESHOLDThe default threshold value.- See Also:
 
 
- 
- 
Constructor Details- 
MultipartConfigurationpublic MultipartConfiguration()
 
- 
- 
Method Details- 
getLocation- Returns:
- The location to store temporary files
 
- 
getMaxFileSizepublic long getMaxFileSize()- Returns:
- The max file size. Defaults to 1MB
 
- 
isEnabledpublic boolean isEnabled()- Specified by:
- isEnabledin interface- Toggleable
- Returns:
- Whether file uploads are enabled. Defaults to true.
 
- 
getEnabledThe 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.
 
- 
isDiskpublic boolean isDisk()- Returns:
- Whether to use disk. Defaults to false.
 
- 
isMixedpublic boolean isMixed()- Returns:
- Whether to use a mixed upload
 
- 
getThresholdpublic long getThreshold()- Returns:
- The threshold to trigger storage to disk
 
- 
setLocationSets the location to store files.- Parameters:
- location- The location
 
- 
setMaxFileSizeSets the max file size. Default value (1048576L => 1MB).- Parameters:
- maxFileSize- The max file size
 
- 
setEnabledpublic void setEnabled(boolean enabled) Sets whether multipart processing is enabled. Default value (false).- Parameters:
- enabled- True if it is enabled
 
- 
setDiskpublic 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
 
- 
setMixedpublic 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.
 
- 
setThresholdSets 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
 
 
-