|
Servlet 3.0 - Apache Tomcat 7.0.42 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Part
This class represents a part as uploaded to the server as part of a
multipart/form-data
request body. The part may represent either
an uploaded file or form data.
Method Summary | |
---|---|
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 |
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. |
void |
write(java.lang.String fileName)
A convenience method to write an uploaded part to disk. |
Method Detail |
---|
java.io.InputStream getInputStream() throws java.io.IOException
InputStream
that can be used to retrieve the
contents of the file.
java.io.IOException
java.lang.String getContentType()
null
if not
defined.
java.lang.String getName()
long getSize()
void write(java.lang.String fileName) throws java.io.IOException
fileName
- The location into which the uploaded part should be
stored. Relative locations are relative to MultipartConfigElement.getLocation()
java.io.IOException
void delete() throws java.io.IOException
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.
java.io.IOException
java.lang.String getHeader(java.lang.String name)
name
- Header name
null
if the header is not
presentjava.util.Collection<java.lang.String> getHeaders(java.lang.String name)
java.util.Collection<java.lang.String> getHeaderNames()
|
Servlet 3.0 - Apache Tomcat 7.0.42 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |