Top Description Fields Constructors Methods
jakarta.servlet

public Class MultipartConfigElement

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

The programmatic equivalent of jakarta.servlet.annotation.MultipartConfig used to configure multi-part handling for a Servlet when registering a Servlet via code.
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
The temporary location to store files
location
)

Create a programmatic multi-part configuration with a specific location and defaults for the remaining configuration elements.

public
MultipartConfigElement(String
The temporary location to store files
location
,
long
The maximum permitted size for a single file
maxFileSize
,
long
The maximum permitted size for a request
maxRequestSize
,
int
The size above which the file is save in the temporary location rather than retained in memory.
fileSizeThreshold
)

Create a programmatic multi-part configuration from the individual configuration elements.

public
MultipartConfigElement(MultipartConfig
The source annotation to copy to create the programmatic equivalent.
annotation
)

Create a programmatic configuration from an annotation.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the size above which the file is save in the temporary location rather than retained in memory.
getFileSizeThreshold
()

Obtain the size above which the file is save in the temporary location rather than retained in memory.

public String

Returns:

the location where temporary files should be stored.
getLocation
()

Obtain the location where temporary files should be stored.

public long

Returns:

the maximum permitted size for a single file.
getMaxFileSize
()

Obtain the maximum permitted size for a single file.

public long

Returns:

the maximum permitted size for a single request.
getMaxRequestSize
()

Obtain the maximum permitted size for a single request.

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)

Create a programmatic multi-part configuration with a specific location and defaults for the remaining configuration elements.

Parameters
location:String

The temporary location to store files

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

Create a programmatic multi-part configuration from the individual configuration elements.

Parameters
location:String

The temporary location to store files

maxFileSize:long

The maximum permitted size for a single file

maxRequestSize:long

The maximum permitted size for a request

fileSizeThreshold:int

The size above which the file is save in the temporary location rather than retained in memory.

MultipartConfigElementback to summary
public MultipartConfigElement(MultipartConfig annotation)

Create a programmatic configuration from an annotation.

Parameters
annotation:MultipartConfig

The source annotation to copy to create the programmatic equivalent.

Method Detail

getFileSizeThresholdback to summary
public int getFileSizeThreshold()

Obtain the size above which the file is save in the temporary location rather than retained in memory.

Returns:int

the size above which the file is save in the temporary location rather than retained in memory.

getLocationback to summary
public String getLocation()

Obtain the location where temporary files should be stored.

Returns:String

the location where temporary files should be stored.

getMaxFileSizeback to summary
public long getMaxFileSize()

Obtain the maximum permitted size for a single file.

Returns:long

the maximum permitted size for a single file.

getMaxRequestSizeback to summary
public long getMaxRequestSize()

Obtain the maximum permitted size for a single request.

Returns:long

the maximum permitted size for a single request.