Package org.eclipse.jetty.http
Class MultiPartFormData.Parser
java.lang.Object
org.eclipse.jetty.http.MultiPartFormData.Parser
- Enclosing class:
- MultiPartFormData
-
Constructor Summary
ConstructorDescriptionParser
(String boundary, MultiPartCompliance multiPartCompliance, ComplianceViolation.Listener complianceViolationListener) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionvoid
configure
(MultiPartConfig config) Configure the Parser given aMultiPartConfig
instance.Returns the default charset as specified by RFC 7578, section 4.6, that is the charset specified by the part named_charset_
.long
long
long
long
int
boolean
parse
(Content.Source content) Deprecated, for removal: This API element is subject to removal in a future version.void
parse
(Content.Source content, Promise<MultiPartFormData.Parts> immediate, Promise.Invocable<MultiPartFormData.Parts> future) parse
(Content.Source content, Invocable.InvocationType invocationType) Deprecated, for removal: This API element is subject to removal in a future version.void
setFilesDirectory
(Path filesDirectory) Sets the directory where the files uploaded in the parts will be saved.void
setMaxFileSize
(long maxFileSize) void
setMaxLength
(long maxLength) void
setMaxMemoryFileSize
(long maxMemoryFileSize) Sets the maximum memory file size in bytes, after which files will be saved in the directory specified bysetFilesDirectory(Path)
.void
setMaxParts
(long maxParts) void
setPartHeadersMaxLength
(int partHeadersMaxLength) void
setUseFilesForPartsWithoutFileName
(boolean useFilesForPartsWithoutFileName)
-
Constructor Details
-
Parser
-
Parser
@Deprecated public Parser(String boundary, MultiPartCompliance multiPartCompliance, ComplianceViolation.Listener complianceViolationListener) Deprecated.useParser(String)
withconfigure(MultiPartConfig)
.
-
-
Method Details
-
parse
public void parse(Content.Source content, Promise<MultiPartFormData.Parts> immediate, Promise.Invocable<MultiPartFormData.Parts> future) -
parse
@Deprecated(forRemoval=true, since="12.0.15") public CompletableFuture<MultiPartFormData.Parts> parse(Content.Source content) Deprecated, for removal: This API element is subject to removal in a future version. -
parse
@Deprecated(forRemoval=true, since="12.0.15") public CompletableFuture<MultiPartFormData.Parts> parse(Content.Source content, Invocable.InvocationType invocationType) Deprecated, for removal: This API element is subject to removal in a future version. -
getBoundary
- Returns:
- the boundary string
-
getDefaultCharset
Returns the default charset as specified by RFC 7578, section 4.6, that is the charset specified by the part named
_charset_
.If that part is not present, returns
null
.- Returns:
- the default charset specified by the
_charset_
part, or null if that part is not present
-
getPartHeadersMaxLength
public int getPartHeadersMaxLength()- Returns:
- the max length of a
MultiPart.Part
headers, in bytes, or -1 for unlimited length
-
setPartHeadersMaxLength
public void setPartHeadersMaxLength(int partHeadersMaxLength) - Parameters:
partHeadersMaxLength
- the max length of aMultiPart.Part
headers, in bytes, or -1 for unlimited length
-
isUseFilesForPartsWithoutFileName
public boolean isUseFilesForPartsWithoutFileName()- Returns:
- whether parts without fileName may be stored as files
-
setUseFilesForPartsWithoutFileName
public void setUseFilesForPartsWithoutFileName(boolean useFilesForPartsWithoutFileName) - Parameters:
useFilesForPartsWithoutFileName
- whether parts without fileName may be stored as files
-
getFilesDirectory
- Returns:
- the directory where files are saved
-
setFilesDirectory
Sets the directory where the files uploaded in the parts will be saved.
- Parameters:
filesDirectory
- the directory where files are saved
-
getMaxFileSize
public long getMaxFileSize()- Returns:
- the maximum file size in bytes, or -1 for unlimited file size
-
setMaxFileSize
public void setMaxFileSize(long maxFileSize) - Parameters:
maxFileSize
- the maximum file size in bytes, or -1 for unlimited file size
-
getMaxMemoryFileSize
public long getMaxMemoryFileSize()- Returns:
- the maximum memory file size in bytes, or -1 for unlimited memory file size
-
setMaxMemoryFileSize
public void setMaxMemoryFileSize(long maxMemoryFileSize) Sets the maximum memory file size in bytes, after which files will be saved in the directory specified by
setFilesDirectory(Path)
.Use value
0
to always save the files in the directory.Use value
-1
to never save the files in the directory.- Parameters:
maxMemoryFileSize
- the maximum memory file size in bytes, or -1 for unlimited memory file size
-
getMaxLength
public long getMaxLength()- Returns:
- the maximum length in bytes of the whole multipart content, or -1 for unlimited length
-
setMaxLength
public void setMaxLength(long maxLength) - Parameters:
maxLength
- the maximum length in bytes of the whole multipart content, or -1 for unlimited length
-
getMaxParts
public long getMaxParts()- Returns:
- the maximum number of parts that can be parsed from the multipart content.
-
setMaxParts
public void setMaxParts(long maxParts) - Parameters:
maxParts
- the maximum number of parts that can be parsed from the multipart content.
-
configure
Configure the Parser given aMultiPartConfig
instance.- Parameters:
config
- the configuration.
-
Parser(String)
withconfigure(MultiPartConfig)
.