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