|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjodd.servlet.upload.FileUpload
public abstract class FileUpload
Encapsulates base for uploaded file. Its instance may be either valid, when it represent an uploaded file, or invalid when uploaded file doesn't exist or there was a problem with it.
MultipartRequest| Field Summary | |
|---|---|
protected boolean |
fileTooBig
|
protected FileUploadHeader |
header
|
protected MultipartRequestInputStream |
input
|
protected int |
maxFileSize
|
protected int |
size
|
protected boolean |
valid
|
| Constructor Summary | |
|---|---|
protected |
FileUpload(MultipartRequestInputStream input,
int maxFileSize)
|
| Method Summary | |
|---|---|
abstract byte[] |
getFileContent()
Returns all bytes of uploaded file. |
abstract java.io.InputStream |
getFileInputStream()
Returns input stream of uploaded file. |
FileUploadHeader |
getHeader()
Returns FileUploadHeader of uploaded file. |
int |
getMaxFileSize()
Returns max file size or -1 if there is no max file size. |
int |
getSize()
Returns the file upload size or -1 if file was not uploaded. |
boolean |
isFileTooBig()
Returns true if file is too big. |
abstract boolean |
isInMemory()
Returns true if uploaded file content is stored in memory. |
boolean |
isUploaded()
Returns true if file was uploaded. |
boolean |
isValid()
Returns true if upload process went correctly. |
protected abstract void |
processStream()
Process request input stream. |
java.lang.String |
toString()
Returns basic information about the uploaded file. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected final MultipartRequestInputStream input
protected final int maxFileSize
protected final FileUploadHeader header
protected boolean valid
protected int size
protected boolean fileTooBig
| Constructor Detail |
|---|
protected FileUpload(MultipartRequestInputStream input,
int maxFileSize)
| Method Detail |
|---|
public FileUploadHeader getHeader()
FileUploadHeader of uploaded file.
public abstract byte[] getFileContent()
throws java.io.IOException
java.io.IOException
public abstract java.io.InputStream getFileInputStream()
throws java.io.IOException
java.io.IOExceptionpublic int getSize()
-1 if file was not uploaded.
public boolean isUploaded()
true if file was uploaded.
public boolean isValid()
true if upload process went correctly.
This still does not mean that file is uploaded, e.g. when file
was not specified on the form.
public int getMaxFileSize()
-1 if there is no max file size.
public boolean isFileTooBig()
true if file is too big. File will be marked as invalid.
public abstract boolean isInMemory()
true if uploaded file content is stored in memory.
protected abstract void processStream()
throws java.io.IOException
size
attribute after successful processing. This method also must set the
valid attribute.
java.io.IOExceptionMultipartRequestInputStreampublic java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||