public abstract class FileUpload
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected boolean |
fileTooBig |
protected FileUploadHeader |
header |
protected MultipartRequestInputStream |
input |
protected int |
maxFileSize |
protected int |
size |
protected boolean |
valid |
Modifier | Constructor and Description |
---|---|
protected |
FileUpload(MultipartRequestInputStream input,
int maxFileSize) |
Modifier and Type | Method and Description |
---|---|
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.
|
protected final MultipartRequestInputStream input
protected final int maxFileSize
protected final FileUploadHeader header
protected boolean valid
protected int size
protected boolean fileTooBig
protected FileUpload(MultipartRequestInputStream input, int maxFileSize)
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.IOException
public 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.IOException
MultipartRequestInputStream
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2003-present Jodd Team