com.opencms.core
Interface I_CmsRequest

All Known Implementing Classes:
CmsExportRequest, CmsRequestHttpServlet

public interface I_CmsRequest

This interface defines an OpenCms request, a generic request object that is used by OpenCms and provides methods to read the data included in the request.

Implementations of this interface use an existing request (e.g. HttpServletRequest) to initialize an I_CmsRequest.

Version:
$Revision: 1.11 $ $Date: 2002/10/30 10:10:11 $
Author:
Michael Emmerich, Alexander Kandzior

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()
           
 String getServerName()
          Methods to get the data from the original request.
 int getServerPort()
           
 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)
          Sets the original request to another value
 void setRequestedResource(String resourceName)
          Set the name returned by getRequestedResource().
 

Method Detail

getFile

public byte[] getFile(String name)
Returns the content of an uploaded file. Returns null if no file with this name has been uploaded with this request. Returns an empty byte[] if a file without content has been uploaded.

Parameters:
name - The name of the uploaded file.
Returns:
The selected uploaded file content.

getFileNames

public Enumeration getFileNames()
Returns the names of all uploaded files in this request. Returns an empty eumeration if no files were included in the request.

Returns:
An Enumeration of file names.

getOriginalRequest

public Object getOriginalRequest()
Returns the original request that was used to create the CmsRequest.

Returns:
The original request of the CmsRequest.

setOriginalRequest

public void setOriginalRequest(Object request)
Sets the original request to another value


getOriginalRequestType

public int getOriginalRequestType()
Returns the type of the request that was used to create the CmsRequest. The returned int must be one of the constants defined above in this interface.

Returns:
The type of the CmsRequest.

getParameter

public String getParameter(String name)
Returns the value of a named parameter as a String. Returns null if the parameter does not exist or an empty string if the parameter exists but without a value.

Parameters:
name - The name of the parameter.
Returns:
The value of the parameter.

getParameterNames

public Enumeration getParameterNames()
Returns all parameter names as an Enumeration of String objects. Returns an empty Enumeratrion if no parameters were included in the request.

Returns:
Enumeration of parameter names.

getParameterValues

public String[] getParameterValues(String key)
Returns all parameter values of a parameter key.

Returns:
Aarray of String containing the parameter values.

getRequestedResource

public String getRequestedResource()
This funtion returns the name of the requested resource.

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.

Returns:
The path to the requested resource.

setRequestedResource

public void setRequestedResource(String resourceName)
Set the name returned by getRequestedResource(). This is required in case there was a folder name requested and a default file (e.g. index.html) has to be used instead of the folder.

Parameters:
resourceName - The name to set the requested resource name to

getWebAppUrl

public String getWebAppUrl()
Returns the part of the Url that descibes the Web-Application. E.g: http://www.myserver.com/opencms/engine/index.html returns http://www.myserver.com/opencms


getServletUrl

public String getServletUrl()
Gets the part of the Url that describes the current servlet of this Web-Application.


getServerName

public String getServerName()
Methods to get the data from the original request.


getScheme

public String getScheme()

getServerPort

public int getServerPort()