Top Description Fields Constructors Methods
jakarta.servlet

public Class MultipartConfigElement

extends Object
Class Inheritance
Imports
jakarta.servlet.annotation.MultipartConfig

Java Class representation of an MultipartConfig annotation value.
Since
Servlet 3.0

Field Summary

Modifier and TypeField and Description
private final int
private final String
private final long
private final long

Constructor Summary

AccessConstructor and Description
public
MultipartConfigElement(String
defaults to "" if values is null.
location
)

Constructs an instance with defaults for all but location.

public
MultipartConfigElement(String
the directory location where files will be stored
location
,
long
the maximum size allowed (in bytes) for uploaded files
maxFileSize
,
long
the maximum size allowed (in bytes) for multipart/form-data requests
maxRequestSize
,
int
the size threshold (in bytes) after which files will be written to disk
fileSizeThreshold
)

Constructs an instance with all values specified.

public
MultipartConfigElement(MultipartConfig
the annotation value
annotation
)

Constructs an instance from a MultipartConfig annotation value.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the size threshold (in bytes) after which files will be written to disk
getFileSizeThreshold
()

Gets the size threshold (in bytes) after which files will be written to disk.

public String

Returns:

the directory location where files will be stored
getLocation
()

Gets the directory location where files will be stored.

public long

Returns:

the maximum size allowed (in bytes) for uploaded files
getMaxFileSize
()

Gets the maximum size allowed (in bytes) for uploaded files.

public long

Returns:

the maximum size allowed (in bytes) for multipart/form-data requests
getMaxRequestSize
()

Gets the maximum size allowed (in bytes) for multipart/form-data requests.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

fileSizeThresholdback to summary
private final int fileSizeThreshold
locationback to summary
private final String location
maxFileSizeback to summary
private final long maxFileSize
maxRequestSizeback to summary
private final long maxRequestSize

Constructor Detail

MultipartConfigElementback to summary
public MultipartConfigElement(String location)

Constructs an instance with defaults for all but location.

Parameters
location:String

defaults to "" if values is null.

MultipartConfigElementback to summary
public MultipartConfigElement(String location, long maxFileSize, long maxRequestSize, int fileSizeThreshold)

Constructs an instance with all values specified.

Parameters
location:String

the directory location where files will be stored

maxFileSize:long

the maximum size allowed (in bytes) for uploaded files

maxRequestSize:long

the maximum size allowed (in bytes) for multipart/form-data requests

fileSizeThreshold:int

the size threshold (in bytes) after which files will be written to disk

MultipartConfigElementback to summary
public MultipartConfigElement(MultipartConfig annotation)

Constructs an instance from a MultipartConfig annotation value.

Parameters
annotation:MultipartConfig

the annotation value

Method Detail

getFileSizeThresholdback to summary
public int getFileSizeThreshold()

Gets the size threshold (in bytes) after which files will be written to disk. A value of zero means files must always be written to disk.

Returns:int

the size threshold (in bytes) after which files will be written to disk

getLocationback to summary
public String getLocation()

Gets the directory location where files will be stored.

Returns:String

the directory location where files will be stored

getMaxFileSizeback to summary
public long getMaxFileSize()

Gets the maximum size allowed (in bytes) for uploaded files.

Returns:long

the maximum size allowed (in bytes) for uploaded files

getMaxRequestSizeback to summary
public long getMaxRequestSize()

Gets the maximum size allowed (in bytes) for multipart/form-data requests.

Returns:long

the maximum size allowed (in bytes) for multipart/form-data requests