|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjodd.servlet.upload.FileUpload
jodd.servlet.upload.impl.AdaptiveFileUpload
public class AdaptiveFileUpload
Smart FileUpload implementation that defer the action of what to do with uploaded file
for later. Internally, it stores uploaded file either in memory if it is small, or, in all
other cases, it stores them in TEMP folder.
| Field Summary | |
|---|---|
protected boolean |
allowFileExtensions
|
protected boolean |
breakOnError
|
protected byte[] |
data
|
protected java.lang.String[] |
fileExtensions
|
protected int |
memoryThreshold
|
protected java.io.File |
tempFile
|
protected static java.lang.String |
TMP_FILE_SUFFIX
|
protected java.io.File |
uploadPath
|
| Fields inherited from class jodd.servlet.upload.FileUpload |
|---|
fileTooBig, header, input, maxFileSize, size, valid |
| Method Summary | |
|---|---|
protected boolean |
checkUpload()
Determines if upload is allowed. |
void |
delete()
Deletes file uploaded item from disk or memory. |
byte[] |
getFileContent()
Returns the content of file upload item. |
java.lang.String[] |
getFileExtensions()
|
java.io.InputStream |
getFileInputStream()
Returns input stream of uploaded file. |
int |
getMemoryThreshold()
|
java.io.File |
getUploadPath()
|
boolean |
isAllowFileExtensions()
|
boolean |
isBreakOnError()
|
boolean |
isInMemory()
Returns true if file upload resides in memory. |
protected boolean |
matchFileExtension()
|
protected void |
processStream()
Process request input stream. |
java.io.File |
write(java.io.File destination)
Writes file upload item to destination folder or to destination file. |
java.io.File |
write(java.lang.String destination)
Writes file uploaded item. |
| Methods inherited from class jodd.servlet.upload.FileUpload |
|---|
getHeader, getMaxFileSize, getSize, isFileTooBig, isUploaded, isValid, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final java.lang.String TMP_FILE_SUFFIX
protected final int memoryThreshold
protected final java.io.File uploadPath
protected final boolean breakOnError
protected final java.lang.String[] fileExtensions
protected final boolean allowFileExtensions
protected java.io.File tempFile
protected byte[] data
| Method Detail |
|---|
public int getMemoryThreshold()
public java.io.File getUploadPath()
public boolean isBreakOnError()
public java.lang.String[] getFileExtensions()
public boolean isAllowFileExtensions()
public boolean isInMemory()
true if file upload resides in memory.
isInMemory in class FileUpload
protected boolean matchFileExtension()
throws java.io.IOException
java.io.IOException
protected boolean checkUpload()
throws java.io.IOException
java.io.IOException
protected void processStream()
throws java.io.IOException
FileUploadsize
attribute after successful processing. This method also must set the
valid attribute.
processStream in class FileUploadjava.io.IOExceptionMultipartRequestInputStreampublic void delete()
public java.io.File write(java.lang.String destination)
throws java.io.IOException
java.io.IOException
public java.io.File write(java.io.File destination)
throws java.io.IOException
java.io.IOException
public byte[] getFileContent()
throws java.io.IOException
getFileContent in class FileUploadjava.io.IOException
public java.io.InputStream getFileInputStream()
throws java.io.IOException
FileUpload
getFileInputStream in class FileUploadjava.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||