|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--com.opencms.core.CmsRequestHttpServlet
Implementation of the I_CmsRequest interface which wraps a HttpServletRequest and includes handling of multipart - requests.
This implementation uses a HttpServletRequest as original request to create a CmsRequestHttpServlet. This either can be a normal HttpServletRequest or a CmsMultipartRequest which is used to upload file into the OpenCms.
This class contains a modification of the MultipartRequest published in the O'Reilly
book
It Constructs a new MultipartRequest to handle the specified request, saving any uploaded files to the given directory, and limiting the upload size to a maximum size of 8 MB by default.
The idea is to modify the given MultiPartRequest to make it transparent to normal requests and store file into CmsFile objects so that they can be transferred into the OpenCms document database.
| Method Summary | |
byte[] |
getFile(String name)
Returns the content of an uploaded file. |
Enumeration |
getFileNames()
Returns the names of all uploaded files in this request. |
Object |
getOriginalRequest()
Returns the original request that was used to create the CmsRequest. |
int |
getOriginalRequestType()
Returns the type of the request that was used to create the CmsRequest. |
String |
getParameter(String name)
Returns the value of a named parameter as a String. |
Enumeration |
getParameterNames()
Returns all parameter names as an Enumeration of String objects. |
String[] |
getParameterValues(String key)
Returns all parameter values of a parameter key. |
String |
getRequestedResource()
This funtion returns the name of the requested resource. |
String |
getScheme()
Methods to get the data from the original request. |
String |
getServerName()
Methods to get the data from the original request. |
int |
getServerPort()
Methods to get the data from the original request. |
String |
getServletUrl()
Gets the part of the Url that describes the current servlet of this Web-Application. |
String |
getWebAppUrl()
Returns the part of the Url that descibes the Web-Application. |
void |
setOriginalRequest(Object request)
Overwrites the original request that was used to create the CmsRequest. |
void |
setRequestedResource(String resourceName)
Set the name returned by getRequestedResource(). |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public byte[] getFile(String name)
getFile in interface I_CmsRequestname - The name of the uploaded file.
public Enumeration getFileNames()
getFileNames in interface I_CmsRequestpublic Object getOriginalRequest()
getOriginalRequest in interface I_CmsRequestpublic void setOriginalRequest(Object request)
setOriginalRequest in interface I_CmsRequestpublic int getOriginalRequestType()
getOriginalRequestType in interface I_CmsRequestpublic String getParameter(String name)
getParameter in interface I_CmsRequestname - The name of the parameter.
public Enumeration getParameterNames()
getParameterNames in interface I_CmsRequestpublic String[] getParameterValues(String key)
getParameterValues in interface I_CmsRequestpublic String getRequestedResource()
For a http request, the name of the resource is extracted as follows:
http://{servername}/{servletpath}/{path to the cms resource}
In the following example:
http://my.work.server/servlet/opencms/system/def/explorer
the requested resource is /system/def/explorer.
getRequestedResource in interface I_CmsRequestpublic void setRequestedResource(String resourceName)
setRequestedResource in interface I_CmsRequestresourceName - The name to set the requested resource name topublic String getWebAppUrl()
getWebAppUrl in interface I_CmsRequestpublic String getServletUrl()
getServletUrl in interface I_CmsRequestpublic String getServerName()
getServerName in interface I_CmsRequestpublic int getServerPort()
getServerPort in interface I_CmsRequestpublic String getScheme()
getScheme in interface I_CmsRequest
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||