|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.waffle.io.RequestFileUploader
public class RequestFileUploader
Request-based FileUploader. The files are uploaded when the object is started. If there are any errors they are
logged and retrievable via the getErrors()
method. An action handling a multipart form should first check
hasErrors()
before doing any other processing.
Note that it is assumed that, by default, resource cleanup should be handled by the FileUpload's cleanup
functionality, as detailed in the user guide. Custom
behaviour can be introduced by overriding the stop()
method.
Field Summary | |
---|---|
protected java.util.Collection<java.lang.String> |
errors
|
protected java.util.List<org.apache.commons.fileupload.FileItem> |
fileItems
|
Constructor Summary | |
---|---|
RequestFileUploader(javax.servlet.http.HttpServletRequest request,
org.apache.commons.fileupload.FileItemFactory itemFactory)
Creates RequestFileUploader |
Method Summary | |
---|---|
java.util.Collection<java.lang.String> |
getErrors()
Returns errors generated when parsing the multipart request. |
java.util.List<org.apache.commons.fileupload.FileItem> |
getFiles()
Returns the uploaded files |
java.util.List<org.apache.commons.fileupload.FileItem> |
getFormFields()
Returns the form fields |
boolean |
hasErrors()
Determines if any errors occured when parsing the multipart request |
void |
start()
Upload files on request start |
void |
stop()
Performs any additional operation on request stop. |
protected void |
uploadFileItems(javax.servlet.http.HttpServletRequest request,
org.apache.commons.fileupload.FileItemFactory itemFactory)
Parses a multipart request to upload file items and records any errors. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.Collection<java.lang.String> errors
protected java.util.List<org.apache.commons.fileupload.FileItem> fileItems
Constructor Detail |
---|
public RequestFileUploader(javax.servlet.http.HttpServletRequest request, org.apache.commons.fileupload.FileItemFactory itemFactory)
request
- the HttpServletRequestitemFactory
- the FileItemFactoryMethod Detail |
---|
public java.util.List<org.apache.commons.fileupload.FileItem> getFiles()
FileUploader
getFiles
in interface FileUploader
public java.util.List<org.apache.commons.fileupload.FileItem> getFormFields()
FileUploader
getFormFields
in interface FileUploader
public java.util.Collection<java.lang.String> getErrors()
FileUploader
getErrors
in interface FileUploader
public boolean hasErrors()
FileUploader
hasErrors
in interface FileUploader
public void start()
start
in interface Startable
public void stop()
stop
in interface Startable
protected void uploadFileItems(javax.servlet.http.HttpServletRequest request, org.apache.commons.fileupload.FileItemFactory itemFactory)
request
- the HttpServletRequestitemFactory
- the FileItemFactory
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |