org.openrdf.util.http
Class FilePart
java.lang.Object
org.openrdf.util.http.FilePart
- public class FilePart
- extends Object
FilePart represents a file uploaded through a multipart/form-data encoded
POST request.
|
Constructor Summary |
FilePart(String name,
String contentType,
byte[] contents)
Construct a new filepart. |
FilePart
public FilePart(String name,
String contentType,
byte[] contents)
- Construct a new filepart. Content type defaults to "application/octet-stream"
if not specified.
getInputStream
public InputStream getInputStream()
throws IOException
- Returns:
- an InputStream on the contents of the file.
Note: a new stream is returned each time.
- Throws:
IOException
size
public int size()
getContentType
public String getContentType()
- Returns:
- the content type of the uploaded file as determined from the request,
or the filename extension.
getName
public String getName()
- Returns:
- the name of the uploaded file as specified in the request.
getBytes
public byte[] getBytes()
- Returns:
- the contents of the uploaded file as specified in the request.
Copyright © 2002-2006 Aduna BV, GNU LGPL License applies.