public class MultiPartProperties extends Object
jersey-multipart
as used in this particular application.Modifier and Type | Field and Description |
---|---|
static String |
BUFFER_THRESHOLD
Name of the resource property for the threshold size (in bytes) above which a body part entity will be
buffered to disk instead of being held in memory.
|
static int |
BUFFER_THRESHOLD_MEMORY_ONLY
The
BUFFER_THRESHOLD property value to keep a body part entity in memory only. |
static int |
DEFAULT_BUFFER_THRESHOLD
Default threshold size for buffer.
|
static String |
MAX_PARTS
Limit the maximum number of parts the multipart entity can have.
|
static String |
MULTI_PART_CONFIG_RESOURCE
Name of a properties resource that (if found in the classpath
for this application) will be used to configure the settings returned
by our getter methods.
|
static String |
TEMP_DIRECTORY
Name of the resource property for the directory to store temporary files containing body parts of multipart message that
extends allowed memory threshold.
|
Constructor and Description |
---|
MultiPartProperties()
Load and customize (if necessary) the configuration values for the
jersey-multipart injection binder. |
Modifier and Type | Method and Description |
---|---|
MultiPartProperties |
bufferThreshold(int threshold)
Set the size (in bytes) of the entity of an incoming
BodyPart before it will be buffered to disk. |
int |
getBufferThreshold()
Get the size (in bytes) of the entity of an incoming
BodyPart before it will be buffered to disk. |
int |
getMaxParts()
Return maximum number of entity parts allowed.
|
String |
getTempDir()
Get the directory to store temporary files containing body parts of multipart message that extends allowed memory
threshold.
|
MultiPartProperties |
maxParts(int maxParts)
Set the maximum number of received parts of a multipart entity.
|
ContextResolver<MultiPartProperties> |
resolver()
Create a
context resolver for a current state of this MultiPartProperties . |
MultiPartProperties |
tempDir(String path)
Set the path to the directory to store temporary files containing body parts of multipart message that extends allowed
memory threshold.
|
public static final int DEFAULT_BUFFER_THRESHOLD
public static final String MULTI_PART_CONFIG_RESOURCE
Name of a properties resource that (if found in the classpath for this application) will be used to configure the settings returned by our getter methods.
The resource name is jersey-multipart-config.properties
.
public static final String BUFFER_THRESHOLD
DEFAULT_BUFFER_THRESHOLD
.public static final int BUFFER_THRESHOLD_MEMORY_ONLY
BUFFER_THRESHOLD
property value to keep a body part entity in memory only.public static final String MAX_PARTS
Limit the maximum number of parts the multipart entity can have. If the limit is over,
the error response status Response.Status.REQUEST_ENTITY_TOO_LARGE
is returned.
By default, the number is unlimited.
public static final String TEMP_DIRECTORY
java.io.tmpdir
system property).public MultiPartProperties()
jersey-multipart
injection binder.IllegalArgumentException
- if the configuration resource
exists, but there are problems reading itpublic int getBufferThreshold()
BodyPart
before it will be buffered to disk. If not
customized, the default value is 4096.public String getTempDir()
public int getMaxParts()
public MultiPartProperties bufferThreshold(int threshold)
BodyPart
before it will be buffered to disk.threshold
- size of body part.MultiPartProperties
instance.public MultiPartProperties tempDir(String path)
path
- path to the temporary directory.MultiPartProperties
instance.public MultiPartProperties maxParts(int maxParts)
maxParts
- The maximum number of entity parts.MultiPartProperties
instance.public ContextResolver<MultiPartProperties> resolver()
context resolver
for a current state of this MultiPartProperties
.Copyright © 2007-2024, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.