|
|||||||||
| Home >> All >> com >> jcorporate >> expresso >> core >> misc >> [ upload overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
com.jcorporate.expresso.core.misc.upload
Class Uploader

java.lang.Objectcom.jcorporate.expresso.core.misc.upload.Uploader
- All Implemented Interfaces:
- org.apache.struts.upload.MultipartRequestHandler
- public class Uploader
- extends java.lang.Object
- implements org.apache.struts.upload.MultipartRequestHandler
- extends java.lang.Object
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 | |
private java.util.Hashtable |
headers
Stores parsed headers as key - value pairs. |
private static org.apache.log4j.Logger |
log
|
static int |
MAX_HEADER_SIZE
A maximum lenght of a single header line that will be parsed. |
private org.apache.struts.action.ActionServlet |
myActionServlet
|
private org.apache.struts.action.ActionMapping |
myMapping
|
private DefaultParameterParser |
myParser
|
| Fields inherited from interface org.apache.struts.upload.MultipartRequestHandler |
ATTRIBUTE_MAX_LENGTH_EXCEEDED |
| Constructor Summary | |
Uploader()
|
|
| Method Summary | |
protected FileItem |
createItem(java.lang.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. |
java.util.Hashtable |
getAllElements()
This method returns all elements of a multipart request. |
protected java.lang.String |
getFieldName()
Retrieves field name from 'Content-disposition' header. |
java.util.Hashtable |
getFileElements()
This method is called on to retrieve all the FormFile input elements of the request. |
protected java.lang.String |
getFileName()
Retrieves file name from 'Content-disposition' header. |
protected java.lang.String |
getHeader(java.lang.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 |
java.util.Hashtable |
getTextElements()
This method is called on to retrieve all the text input elements of the request. |
void |
handleRequest(javax.servlet.http.HttpServletRequest request)
After constructed, this is the first method called on by ActionServlet. |
protected void |
parseHeaders(java.lang.String headerPart)
Parses the header-part and stores as key -
value pairs. |
void |
parseRequest(javax.servlet.http.HttpServletRequest req,
ParameterParser params,
java.lang.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 |
MAX_HEADER_SIZE
public static final int MAX_HEADER_SIZE
- A maximum lenght of a single header line that will be
parsed. (1024 bytes).
- See Also:
- Constant Field Values
headers
private java.util.Hashtable headers
- Stores parsed headers as key - value pairs.
myParser
private DefaultParameterParser myParser
myMapping
private org.apache.struts.action.ActionMapping myMapping
myActionServlet
private org.apache.struts.action.ActionServlet myActionServlet
log
private static org.apache.log4j.Logger log
| Constructor Detail |
Uploader
public Uploader()
| Method Detail |
parseRequest
public void parseRequest(javax.servlet.http.HttpServletRequest req, ParameterParser params, java.lang.String path) throws com.jcorporate.expresso.core.controller.ControllerException
- Processes an RFC
1867 compliant
multipart/form-datastream.
getFieldName
protected java.lang.String getFieldName()
Retrieves field name from 'Content-disposition' header.
getFileName
protected java.lang.String getFileName()
Retrieves file name from 'Content-disposition' header.
createItem
protected FileItem createItem(java.lang.String path, int requestSize, boolean storeAsFile)
Creates a new instance of a FileItem.
parseHeaders
protected void parseHeaders(java.lang.String headerPart)
Parses the
header-partand 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.
getHeader
protected java.lang.String getHeader(java.lang.String name)
Returns a header with specified name.
setServlet
public void setServlet(org.apache.struts.action.ActionServlet servlet)
- Convienience method to set a reference to a working
ActionServlet instance.
- Specified by:
setServletin interfaceorg.apache.struts.upload.MultipartRequestHandler
setMapping
public void setMapping(org.apache.struts.action.ActionMapping mapping)
- Convienience method to set a reference to a working
ActionMapping instance.
- Specified by:
setMappingin interfaceorg.apache.struts.upload.MultipartRequestHandler
getServlet
public org.apache.struts.action.ActionServlet getServlet()
- Get the ActionServlet instance
- Specified by:
getServletin interfaceorg.apache.struts.upload.MultipartRequestHandler
getMapping
public org.apache.struts.action.ActionMapping getMapping()
- Get the ActionMapping instance for this request
- Specified by:
getMappingin interfaceorg.apache.struts.upload.MultipartRequestHandler
handleRequest
public void handleRequest(javax.servlet.http.HttpServletRequest request) throws javax.servlet.ServletException
- After constructed, this is the first method called on
by ActionServlet. Use this method for all your
data-parsing of the ServletInputStream in the request
- Specified by:
handleRequestin interfaceorg.apache.struts.upload.MultipartRequestHandler
getTextElements
public java.util.Hashtable getTextElements()
- This method is called on to retrieve all the text
input elements of the request.
- Specified by:
getTextElementsin interfaceorg.apache.struts.upload.MultipartRequestHandler
getFileElements
public java.util.Hashtable getFileElements()
- This method is called on to retrieve all the FormFile
input elements of the request.
- Specified by:
getFileElementsin interfaceorg.apache.struts.upload.MultipartRequestHandler
getAllElements
public java.util.Hashtable getAllElements()
- This method returns all elements of a multipart request.
- Specified by:
getAllElementsin interfaceorg.apache.struts.upload.MultipartRequestHandler
rollback
public void rollback()
- This method is called on when there's some sort of problem
and the form post needs to be rolled back. Providers
should remove any FormFiles used to hold information
by setting them to null and also physically delete
them if the implementation calls for writing directly
to disk.
NOTE: Currently implemented but not automatically
supported, ActionForm implementors must call rollback()
manually for rolling back file uploads.
- Specified by:
rollbackin interfaceorg.apache.struts.upload.MultipartRequestHandler
finish
public void finish()
- This method is called on when a successful form post
has been made. Some implementations will use this
to destroy temporary files or write to a database
or something of that nature
- Specified by:
finishin interfaceorg.apache.struts.upload.MultipartRequestHandler
|
|||||||||
| Home >> All >> com >> jcorporate >> expresso >> core >> misc >> [ upload overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
com.jcorporate.expresso.core.misc.upload.Uploader