public class FileField extends FormField
| Constructor and Description |
|---|
FileField(FileItem f)
Constructs a new file upload field.
|
| Modifier and Type | Method and Description |
|---|---|
void |
delete()
Deletes the underlying storage for a file item, including deleting any associated temporary disk file.
|
byte[] |
getBytes()
Returns the contents of the file item as an array of bytes.
|
String |
getContentType()
Returns the content type passed by the browser or null if not defined.
|
String |
getFileName()
Returns the original filename in the client's filesystem, as provided by the browser (or other client software).
|
InputStream |
getInputStream()
Returns an InputStream that can be used to retrieve the contents of the file.
|
String |
getName()
Returns the original filename in the client's filesystem.
|
long |
getSize()
Returns the size of the file item.
|
String |
getString()
Returns the contents of the file item as a String, using the system default encoding.
|
String |
getString(String encoding)
Returns the contents of the file item as a String, using the specified encoding.
|
String |
getValue()
Returns the contents of the file item as a String, using the system default encoding.
|
void |
write(File file)
A convenience method to write an uploaded item to disk.
|
public FileField(FileItem f)
public void delete()
public byte[] getBytes()
public String getContentType()
public String getFileName()
public InputStream getInputStream() throws IOException
IOExceptionpublic String getName()
public long getSize()
public String getString()
public String getString(String encoding) throws UnsupportedEncodingException
UnsupportedEncodingExceptionpublic String getValue()
Copyright © 2008-2012 Anders Møller & Mathias Schwarz.