|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.clients.web.fileupload.UploadedFile
public class UploadedFile
Objects of this class can be used to get information about an uploaded file and save the file to a directory in the filesystem. If the file is not saved, it will be deleted once the object is garbage collected.
Field Summary | |
---|---|
private String |
filename
|
private String |
formName
|
private FileUpload |
fu
|
private String |
mimeType
|
Constructor Summary | |
---|---|
UploadedFile(FileUpload fu,
String formName,
String filename,
String mimeType)
Create a new UploadedFile object. |
Method Summary | |
---|---|
String |
getExtension()
Get the extension of the original filename. |
String |
getFilename()
Get the original filename of the uploaded file. |
String |
getFormName()
Get the name of the form field that this file was selected in. |
InputStream |
getInputStream()
Get an input stream for uploading the file. |
String |
getMimeType()
Get the MIME type of the uploaded file. |
void |
writeTo(OutputStream out)
Upload the file and write the data to the specified output stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private FileUpload fu
private final String formName
private final String filename
private final String mimeType
Constructor Detail |
---|
UploadedFile(FileUpload fu, String formName, String filename, String mimeType)
UploadedFile
object.
Use the FileUpload.getFile(String)
or FileUpload.getFileValues(String)
method to get an object representing the uploaded file.
fu
- The FileUpload
object responsible for the uploadformName
- The name of the form field with this filemimeType
- The MIME type of the file, or NULL if it is not knownfilename
- The original filename of the file, or NULL if it is not knownMethod Detail |
---|
public String getFormName()
public String getFilename()
public String getExtension()
public String getMimeType()
public void writeTo(OutputStream out) throws IOException, UploadAbortedException
out
- The stream to write to
IOException
UploadAbortedException
public InputStream getInputStream() throws IOException, UploadAbortedException
IOException
- If reading the input stream fails.
UploadAbortedException
- If the upload has been requested to be aborted.
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |