|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectwicket.markup.html.form.upload.FileUpload
public class FileUpload
Model for file uploads.
| Method Summary | |
|---|---|
void |
delete()
Deletes temp file from disk |
byte[] |
getBytes()
|
java.lang.String |
getClientFileName()
|
java.lang.String |
getContentType()
|
java.io.File |
getFile()
Deprecated. - this method was very counterintuitive. its been replaced by getClientFileName(). see bug 1372481. |
java.io.InputStream |
getInputStream()
Get an input stream for the file uploaded. |
long |
getSize()
|
void |
writeTo(java.io.File file)
Saves this file upload to a given file on the server side. |
java.io.File |
writeToTempFile()
Convinience method that copies the input stream returned by getInputStream() into a temporary file. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public void delete()
public byte[] getBytes()
public java.lang.String getContentType()
public java.io.File getFile()
public java.lang.String getClientFileName()
public java.io.InputStream getInputStream()
throws java.io.IOException
writeTo(File) for persisting the uploaded file. This
can be if you need to react upon the content of the file or need to
persist it elsewhere, i.e. a database or external filesystem.
PLEASE NOTE!
The InputStream return will be closed be Wicket at the end of the request.
If you need it across a request you need to hold on to this FileUpload
instead.
java.io.IOExceptionpublic long getSize()
public void writeTo(java.io.File file)
throws java.io.IOException
file - The file
java.io.IOException
public final java.io.File writeToTempFile()
throws java.io.IOException
getInputStream() into a temporary file.
Only use this if you actually need a File to work with, in all
other cases use getInputStream() or getBytes()
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||