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.Part
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.
public java.lang.String getContentType()
javax.servlet.http.Part
null
if not
defined.getContentType
in interface Part
public java.lang.String getHeader(java.lang.String name)
javax.servlet.http.Part
public java.util.Collection<java.lang.String> getHeaderNames()
javax.servlet.http.Part
getHeaderNames
in interface Part
public java.util.Collection<java.lang.String> getHeaders(java.lang.String name)
javax.servlet.http.Part
getHeaders
in interface Part
public java.io.InputStream getInputStream() throws java.io.IOException
javax.servlet.http.Part
InputStream
that can be used to retrieve the
contents of the file.getInputStream
in interface Part
java.io.IOException
public java.lang.String getName()
javax.servlet.http.Part
public long getSize()
javax.servlet.http.Part
public void write(java.lang.String fileName) throws java.io.IOException
javax.servlet.http.Part
write
in interface Part
fileName
- The location into which the uploaded part should be
stored. Relative locations are relative to MultipartConfigElement.getLocation()
java.io.IOException
public 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-2015 Apache Software Foundation. All Rights Reserved.