| Constructor and Description |
|---|
ApplicationPart(FileItem fileItem,
java.io.File location) |
| Modifier and Type | Method and Description |
|---|---|
void |
delete()
Deletes the underlying storage for a part, including deleting any
associated temporary disk file.
|
java.lang.String |
getContentType()
Obtain the content type passed by the browser or
null if not
defined. |
java.lang.String |
getFilename()
Deprecated.
Use
getSubmittedFileName() from Servlet 3.1 instead.
This method will be removed in Tomcat 8. |
java.lang.String |
getHeader(java.lang.String name)
Obtains the value of the specified part header as a String.
|
java.util.Collection<java.lang.String> |
getHeaderNames()
Returns a Collection of all the header names provided for this part.
|
java.util.Collection<java.lang.String> |
getHeaders(java.lang.String name)
Obtain all the values of the specified part header.
|
java.io.InputStream |
getInputStream()
Obtain an
InputStream that can be used to retrieve the
contents of the file. |
java.lang.String |
getName()
Obtain the name of the field in the multipart form corresponding to this
part.
|
long |
getSize()
Obtain the size of this part.
|
java.lang.String |
getString(java.lang.String encoding) |
java.lang.String |
getSubmittedFileName()
Adapted from FileUploadBase.getFileName().
|
void |
write(java.lang.String fileName)
A convenience method to write an uploaded part to disk.
|
public ApplicationPart(FileItem fileItem, java.io.File location)
public void delete()
throws java.io.IOException
javax.servlet.http.PartContainers 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.
public java.lang.String getContentType()
javax.servlet.http.Partnull if not
defined.getContentType in interface Partpublic java.lang.String getHeader(java.lang.String name)
javax.servlet.http.Partpublic java.util.Collection<java.lang.String> getHeaderNames()
javax.servlet.http.PartgetHeaderNames in interface Partpublic java.util.Collection<java.lang.String> getHeaders(java.lang.String name)
javax.servlet.http.PartgetHeaders in interface Partpublic java.io.InputStream getInputStream()
throws java.io.IOException
javax.servlet.http.PartInputStream that can be used to retrieve the
contents of the file.getInputStream in interface Partjava.io.IOExceptionpublic java.lang.String getName()
javax.servlet.http.Partpublic long getSize()
javax.servlet.http.Partpublic void write(java.lang.String fileName)
throws java.io.IOException
javax.servlet.http.Partwrite in interface PartfileName - The location into which the uploaded part should be
stored. Relative locations are relative to MultipartConfigElement.getLocation()java.io.IOExceptionpublic java.lang.String getString(java.lang.String encoding)
throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException@Deprecated public java.lang.String getFilename()
getSubmittedFileName() from Servlet 3.1 instead.
This method will be removed in Tomcat 8.getSubmittedFileName().public java.lang.String getSubmittedFileName()
Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.