multipart/form-data request body.
The part may represent either an uploaded file or form data.
| Modifier and Type | Method and Description |
|---|---|
| public void | delete()
Deletes the underlying storage for a part, including deleting any associated temporary disk file. |
| public String | Returns: The content type passed by the browser ornull if not defined.Obtain the content type passed by the browser. |
| public String | |
| public Collection | Returns: a Collection of all the header names provided for this part.Get the header names provided for this part. |
| public Collection | Returns: All the values of the specified part header. If the part did not include any headers of the specified name, this method returns an empty Collection.The name of the header of interest. The header name is case insensitive. name)Obtain all the values of the specified part header. |
| public InputStream | Returns: An InputStream for the contents of the fileObtain an |
| public String | Returns: The name of the field in the multipart form corresponding to this part.Obtain the name of the field in the multipart form corresponding to this part. |
| public long | |
| public String | Returns: the submitted file name ornull.If this part represents an uploaded file, gets the file name submitted in the upload. |
| public void | write(String
The location into which the uploaded part should be stored. Relative locations are relative to
fileName)jakarta.A convenience method to write an uploaded part to disk. |
| delete | back to summary |
|---|---|
| public void delete() throws IOException Deletes the underlying storage for a part, including deleting any associated temporary disk file. Although the container will delete this storage automatically this method can be used to ensure that this is done at an earlier time, thus preserving system resources. Containers are only required to delete the associated storage when the Part instance is garbage collected. Apache Tomcat will delete the associated storage when the associated request has finished processing. Behaviour of other containers may be different.
| |
| getContentType | back to summary |
|---|---|
| public String getContentType() Obtain the content type passed by the browser.
| |
| getHeader | back to summary |
|---|---|
| public String getHeader(String name) Obtains the value of the specified part header as a String. If there are multiple headers with the same name, this method returns the first header in the part. The header name is case insensitive. | |
| getHeaderNames | back to summary |
|---|---|
| public Collection Get the header names provided for this part.
| |
| getHeaders | back to summary |
|---|---|
| public Collection Obtain all the values of the specified part header.
| |
| getInputStream | back to summary |
|---|---|
| public InputStream getInputStream() throws IOException Obtain an
| |
| getName | back to summary |
|---|---|
| public String getName() Obtain the name of the field in the multipart form corresponding to this part.
| |
| getSize | back to summary |
|---|---|
| public long getSize() Obtain the size of this part.
| |
| getSubmittedFileName | back to summary |
|---|---|
| public String getSubmittedFileName() If this part represents an uploaded file, gets the file name submitted in the upload. Returns
| |
| write | back to summary |
|---|---|
| public void write(String fileName) throws IOException A convenience method to write an uploaded part to disk. The client code is not concerned with whether or not the part is stored in memory, or on disk in a temporary location. They just want to write the uploaded part to a file. 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.
| |