Servlet specific class for multipart content support.
Use from(ServletRequest) to
parse multipart request content into a Parts object that can
be used to access Servlet Part objects.
Parts
| Modifier and Type | Class and Description |
|---|---|
| public static class | ServletMultiPartFormData.Parts
An ordered list of |
| private static class |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static CompletableFuture | Returns: A futureServletMultiPartFormData., which may have already been created and/or completed.A servlet request servletRequest)Get future |
| public static CompletableFuture | Returns: A futureServletMultiPartFormData., which may have already been created and/or completed.A servlet request servletRequest, String The contentType, passed as an optimization as it has likely already been retrieved. contentType)Get future |
| ServletMultiPartFormData | back to summary |
|---|---|
| public ServletMultiPartFormData() | |
| from | back to summary |
|---|---|
| public static CompletableFuture Get future
| |
| from | back to summary |
|---|---|
| public static CompletableFuture Get future
| |
An ordered list of Parts that can be accessed by name.
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Part | |
| public Collection |
| parts | back to summary |
|---|---|
| private final List<Part> parts | |
| Parts | back to summary |
|---|---|
| public Parts(Path directory, MultiPartFormData. | |
| getPart | back to summary |
|---|---|
| public Part getPart(String name) | |
| getParts | back to summary |
|---|---|
| public Collection | |
| Modifier and Type | Field and Description |
|---|---|
| private final Path | |
| private final MultiPart. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public void | delete()
Implements jakarta. |
| public String | getContentType()
Implements jakarta. |
| public String | getHeader(String
a name)String specifying the header nameImplements jakarta. String.
|
| public Collection | getHeaderNames()
Implements jakarta. |
| public Collection | getHeaders(String
the header name whose values to return name)Implements jakarta. |
| public InputStream | getInputStream()
Implements jakarta. |
| public String | |
| public long | |
| public String | getSubmittedFileName()
Implements jakarta. |
| public String | |
| public void | write(String
The location into which the uploaded part should be stored. Relative paths are relative to
fileName)jakarta.servlet.MultipartConfigElement#getLocation(). Absolute paths are used as provided.Note that this is a system dependent string and URI notation may not be acceptable on all systems. For portability, this string should be generated with the File or Path APIs. Implements jakarta. |
| _directory | back to summary |
|---|---|
| private final Path _directory | |
| _part | back to summary |
|---|---|
| private final MultiPart. | |
| ServletPart | back to summary |
|---|---|
| private ServletPart(Path directory, MultiPart. | |
| delete | back to summary |
|---|---|
| public void delete() throws IOException Implements jakarta. Doc from jakarta. Deletes the underlying storage for a file item, including deleting any associated temporary disk file.
| |
| getContentType | back to summary |
|---|---|
| public String getContentType() Implements jakarta. Doc from jakarta. Gets the content type of this part. | |
| getHeader | back to summary |
|---|---|
| public String getHeader(String name) Implements jakarta. Doc from jakarta. Returns the value of the specified mime header as a | |
| getHeaderNames | back to summary |
|---|---|
| public Collection Implements jakarta. Doc from jakarta. Gets the header names of this Part.
Some servlet containers do not allow servlets to access headers using this method, in which case this method returns
Any changes to the returned
| |
| getHeaders | back to summary |
|---|---|
| public Collection Implements jakarta. Doc from jakarta. Gets the values of the Part header with the given name.
Any changes to the returned Part header names are case insensitive.
| |
| getInputStream | back to summary |
|---|---|
| public InputStream getInputStream() throws IOException Implements jakarta. Doc from jakarta. Gets the content of this part as an InputStream
| |
| getName | back to summary |
|---|---|
| public String getName() Implements jakarta. Doc from jakarta. Gets the name of this part | |
| getSize | back to summary |
|---|---|
| public long getSize() Implements jakarta. Doc from jakarta. Returns the size of this file.
| |
| getSubmittedFileName | back to summary |
|---|---|
| public String getSubmittedFileName() Implements jakarta. Doc from jakarta. Gets the file name specified by the client | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| write | back to summary |
|---|---|
| public void write(String fileName) throws IOException Implements jakarta. Doc from jakarta. A convenience method to write this uploaded item to disk. This method is not guaranteed to succeed if called more than once for the same part. This allows a particular implementation to use, for example, file renaming, where possible, rather than copying all of the underlying data, thus gaining a significant performance benefit.
| |