|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.jcorporate.expresso.core.misc.upload.Uploader
Files will be stored in temporary disk storage
This implementation of Uploader handles multiple
files per single html widget, sent using multipar/mixed encoding
type, as specified by RFC 1867. Use org.apache.turbine.util.ParameterParser#getFileItems(String) to
acquire an array of org.apache.turbine.util.upload.FileItems associated with given
html widget.
| Field Summary | |
static int |
MAX_HEADER_SIZE
A maximum lenght of a single header line that will be parsed. (1024 bytes). |
| Fields inherited from interface org.apache.struts.upload.MultipartRequestHandler |
ATTRIBUTE_MAX_LENGTH_EXCEEDED |
| Constructor Summary | |
Uploader()
|
|
| Method Summary | |
protected FileItem |
createItem(String path,
int requestSize,
boolean storeAsFile)
Creates a new instance of a FileItem. |
void |
finish()
This method is called on when a successful form post has been made. |
Hashtable |
getAllElements()
This method returns all elements of a multipart request. |
protected String |
getFieldName()
Retrieves field name from 'Content-disposition' header. |
Hashtable |
getFileElements()
This method is called on to retrieve all the FormFile input elements of the request. |
protected String |
getFileName()
Retrieves file name from 'Content-disposition' header. |
protected String |
getHeader(String name)
Returns a header with specified name. |
org.apache.struts.action.ActionMapping |
getMapping()
Get the ActionMapping instance for this request |
org.apache.struts.action.ActionServlet |
getServlet()
Get the ActionServlet instance |
Hashtable |
getTextElements()
This method is called on to retrieve all the text input elements of the request. |
void |
handleRequest(HttpServletRequest request)
After constructed, this is the first method called on by ActionServlet. |
protected void |
parseHeaders(String headerPart)
Parses the header-part and stores as key -
value pairs.
|
void |
parseRequest(HttpServletRequest req,
ParameterParser params,
String path)
Processes an RFC 1867 compliant multipart/form-data stream. |
void |
rollback()
This method is called on when there's some sort of problem and the form post needs to be rolled back. |
void |
setMapping(org.apache.struts.action.ActionMapping mapping)
Convienience method to set a reference to a working ActionMapping instance. |
void |
setServlet(org.apache.struts.action.ActionServlet servlet)
Convienience method to set a reference to a working ActionServlet instance. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int MAX_HEADER_SIZE
| Constructor Detail |
public Uploader()
| Method Detail |
public void parseRequest(HttpServletRequest req,
ParameterParser params,
String path)
throws ControllerException
multipart/form-data stream.
req - The servlet request to be parsed.params - The ParameterParser instance to insert form
fields into.path - The location where the files should be stored.
ControllerException - If there are problems reading/parsing
the request or storing files.protected String getFieldName()
Retrieves field name from 'Content-disposition' header.
encapsulation.protected String getFileName()
Retrieves file name from 'Content-disposition' header.
encapsulation.
protected FileItem createItem(String path,
int requestSize,
boolean storeAsFile)
Creates a new instance of a FileItem.
path - The path for the FileItem.requestSize - The size of the request.
FileItem.protected void parseHeaders(String headerPart)
Parses the header-part and stores as key -
value pairs.
If there are multiple headers of the same names, the name will map to a comma-separated list containing the values.
headerPart - The header-part of the current
encapsulation.protected String getHeader(String name)
Returns a header with specified name.
name - The name of the header to fetch.
public void setServlet(org.apache.struts.action.ActionServlet servlet)
setServlet in interface org.apache.struts.upload.MultipartRequestHandlerpublic void setMapping(org.apache.struts.action.ActionMapping mapping)
setMapping in interface org.apache.struts.upload.MultipartRequestHandlerpublic org.apache.struts.action.ActionServlet getServlet()
getServlet in interface org.apache.struts.upload.MultipartRequestHandlerpublic org.apache.struts.action.ActionMapping getMapping()
getMapping in interface org.apache.struts.upload.MultipartRequestHandler
public void handleRequest(HttpServletRequest request)
throws ServletException
handleRequest in interface org.apache.struts.upload.MultipartRequestHandlerServletException - thrown if something goes wrongpublic Hashtable getTextElements()
getTextElements in interface org.apache.struts.upload.MultipartRequestHandlerpublic Hashtable getFileElements()
getFileElements in interface org.apache.struts.upload.MultipartRequestHandlerFormFilepublic Hashtable getAllElements()
getAllElements in interface org.apache.struts.upload.MultipartRequestHandlerpublic void rollback()
rollback in interface org.apache.struts.upload.MultipartRequestHandlerpublic void finish()
finish in interface org.apache.struts.upload.MultipartRequestHandler
|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||