FileItem objects generated by the package renamed commons-upload to be used by the Servlet
3.0 upload API that expects Parts.
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | delete()
Implements jakarta. Deletes the underlying storage for a part, including deleting any associated temporary disk file. |
| public String | getContentType()
Implements jakarta. Obtain the content type passed by the browser. |
| public String | getHeader(String
Header name name)Implements jakarta. Obtains the value of the specified part header as a String. |
| public Collection | getHeaderNames()
Implements jakarta. Get the header names provided for this part. |
| public Collection | getHeaders(String
The name of the header of interest. The header name is case insensitive. name)Implements jakarta. Obtain all the values of the specified part header. |
| public InputStream | getInputStream()
Implements jakarta. Obtain an |
| public String | getName()
Implements jakarta. Obtain the name of the field in the multipart form corresponding to this part. |
| public long | |
| public String | |
| public String | getSubmittedFileName()
Implements jakarta. 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.Implements jakarta. A convenience method to write an uploaded part to disk. |
| fileItem | back to summary |
|---|---|
| private final FileItem fileItem | |
| location | back to summary |
|---|---|
| private final File location | |
| ApplicationPart | back to summary |
|---|---|
| public ApplicationPart(FileItem fileItem, File location) | |
| delete | back to summary |
|---|---|
| public void delete() throws IOException Implements jakarta. Doc from jakarta. 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() Implements jakarta. Doc from jakarta. Obtain the content type passed by the browser. | |
| getHeader | back to summary |
|---|---|
| public String getHeader(String name) Implements jakarta. Doc from jakarta. 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 Implements jakarta. Doc from jakarta. Get the header names provided for this part.
| |
| getHeaders | back to summary |
|---|---|
| public Collection Implements jakarta. Doc from jakarta. Obtain all the values of the specified part header.
| |
| getInputStream | back to summary |
|---|---|
| public InputStream getInputStream() throws IOException Implements jakarta. Doc from jakarta. Obtain an
| |
| getName | back to summary |
|---|---|
| public String getName() Implements jakarta. Doc from jakarta. Obtain the name of the field in the multipart form corresponding to this part. | |
| getSize | back to summary |
|---|---|
| public long getSize() Implements jakarta. Doc from jakarta. Obtain the size of this part.
| |
| getString | back to summary |
|---|---|
| public String getString(String encoding) throws UnsupportedEncodingException, IOException | |
| getSubmittedFileName | back to summary |
|---|---|
| public String getSubmittedFileName() Implements jakarta. Doc from jakarta. 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 Implements jakarta. Doc from jakarta. 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.
| |