com.uwyn.rife.servlet
Class HttpRequest

java.lang.Object
  extended by com.uwyn.rife.servlet.HttpRequest
All Implemented Interfaces:
Request

public class HttpRequest
extends Object
implements Request


Constructor Summary
HttpRequest(HttpServletRequest request)
           
 
Method Summary
 Object getAttribute(String name)
          See ServletRequest.getAttribute(String).
 Enumeration getAttributeNames()
          See ServletRequest.getAttributeNames().
 String getCharacterEncoding()
          See ServletRequest.getCharacterEncoding().
 String getContentType()
          See ServletRequest.getContentType().
 String getContextPath()
          See HttpServletRequest.getContextPath().
 Cookie getCookie(String name)
          Retrieves a cookie.
 Cookie[] getCookies()
          See HttpServletRequest.getCookies().
 long getDateHeader(String name)
          See HttpServletRequest.getDateHeader(String).
 UploadedFile getFile(String name)
          Retrieves an uploaded file.
 Map<String,UploadedFile[]> getFiles()
          Retrieves the files that were uploaded in this request.
 UploadedFile[] getFiles(String name)
          Retrieves all files that have been uploaded for a particular name.
 String getHeader(String name)
          See HttpServletRequest.getHeader(String).
 Enumeration getHeaderNames()
          See HttpServletRequest.getHeaderNames().
 Enumeration getHeaders(String name)
          See HttpServletRequest.getHeaders(String).
 HttpServletRequest getHttpServletRequest()
          Retrieves the underlying HttpServletRequest.
 int getIntHeader(String name)
          See HttpServletRequest.getIntHeader(String).
 Locale getLocale()
          See ServletRequest.getLocale().
 Enumeration getLocales()
          See ServletRequest.getLocales().
 RequestMethod getMethod()
          See HttpServletRequest.getMethod().
 Map<String,String[]> getParameters()
          Retrieves the parameters that were sent in this request.
 String getProtocol()
          See ServletRequest.getProtocol().
 String getRemoteAddr()
          See ServletRequest.getRemoteAddr().
 String getRemoteHost()
          See ServletRequest.getRemoteHost().
 String getRemoteUser()
          See HttpServletRequest.getRemoteUser().
 RequestDispatcher getRequestDispatcher(String url)
          See ServletRequest.getRequestDispatcher(String).
 String getScheme()
          See ServletRequest.getScheme().
 String getServerName()
          See ServletRequest.getServerName().
 int getServerPort()
          See ServletRequest.getServerPort().
 String getServerRootUrl(int port)
          Returns the root URL of the server that is running this web applications.
 HttpSession getSession()
          See HttpServletRequest.getSession().
 HttpSession getSession(boolean create)
          See HttpServletRequest.getSession(boolean).
 boolean hasAttribute(String name)
          Checks if a request attribute exists.
 boolean hasCookie(String name)
          Checks whether a cookie is present.
 boolean hasFile(String name)
          Checks if a particular file has been uploaded in this request.
 void init(StateStore stateStore)
          Initialize the state of this request from a StateStore.
 boolean isSecure()
          See ServletRequest.isSecure().
 void removeAttribute(String name)
          See ServletRequest.removeAttribute(String).
 void setAttribute(String name, Object object)
          See ServletRequest.setAttribute(String, Object).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpRequest

public HttpRequest(HttpServletRequest request)
            throws EngineException
Throws:
EngineException
Method Detail

init

public void init(StateStore stateStore)
Description copied from interface: Request
Initialize the state of this request from a StateStore.

This method is only there to be used by the web engine, it should never be called manually.

Specified by:
init in interface Request
Parameters:
stateStore - the StateStore that will be used to initialize the request

getMethod

public RequestMethod getMethod()
Description copied from interface: Request
See HttpServletRequest.getMethod().

Specified by:
getMethod in interface Request

getParameters

public Map<String,String[]> getParameters()
Description copied from interface: Request
Retrieves the parameters that were sent in this request.

Specified by:
getParameters in interface Request
Returns:
a Map with all the parameter names and values

getFiles

public Map<String,UploadedFile[]> getFiles()
Description copied from interface: Request
Retrieves the files that were uploaded in this request.

Specified by:
getFiles in interface Request
Returns:
a Map with all the uploaded files
See Also:
Request.hasFile(String), Request.getFile(String), Request.getFiles(String)

hasFile

public boolean hasFile(String name)
Description copied from interface: Request
Checks if a particular file has been uploaded in this request.

Specified by:
hasFile in interface Request
Parameters:
name - the name of the file, as declared in the submission
Returns:
true if the file was uploaded; or

false otherwise

See Also:
Request.getFiles(), Request.getFile(String), Request.getFiles(String)

getFile

public UploadedFile getFile(String name)
Description copied from interface: Request
Retrieves an uploaded file.

Specified by:
getFile in interface Request
Parameters:
name - the name of the file, as declared in the submission
Returns:
the uploaded file; or

null if no file was uploaded

See Also:
Request.getFiles(), Request.hasFile(String), Request.getFiles(String)

getFiles

public UploadedFile[] getFiles(String name)
Description copied from interface: Request
Retrieves all files that have been uploaded for a particular name.

Specified by:
getFiles in interface Request
Parameters:
name - the name of the file, as declared in the submission
Returns:
the uploaded files; or

null if no files were uploaded for that name

See Also:
Request.getFiles(), Request.hasFile(String), Request.getFile(String)

hasCookie

public boolean hasCookie(String name)
Description copied from interface: Request
Checks whether a cookie is present.

Specified by:
hasCookie in interface Request
Parameters:
name - the name of the cookie
Returns:
true if the cookie was present; or

false otherwise

See Also:
Request.getCookie(String), Request.getCookies()

getCookie

public Cookie getCookie(String name)
Description copied from interface: Request
Retrieves a cookie.

Specified by:
getCookie in interface Request
Parameters:
name - the name of the cookie.
Returns:
the instance of the cookie; or

null if no such cookie is present

See Also:
Request.hasCookie(String), Request.getCookies()

getCookies

public Cookie[] getCookies()
Description copied from interface: Request
See HttpServletRequest.getCookies().

Specified by:
getCookies in interface Request

getAttribute

public Object getAttribute(String name)
Description copied from interface: Request
See ServletRequest.getAttribute(String).

Specified by:
getAttribute in interface Request

hasAttribute

public boolean hasAttribute(String name)
Description copied from interface: Request
Checks if a request attribute exists.

Specified by:
hasAttribute in interface Request
Parameters:
name - a String specifying the name of the attribute

false otherwise


getAttributeNames

public Enumeration getAttributeNames()
Description copied from interface: Request
See ServletRequest.getAttributeNames().

Specified by:
getAttributeNames in interface Request

getCharacterEncoding

public String getCharacterEncoding()
Description copied from interface: Request
See ServletRequest.getCharacterEncoding().

Specified by:
getCharacterEncoding in interface Request

getContentType

public String getContentType()
Description copied from interface: Request
See ServletRequest.getContentType().

Specified by:
getContentType in interface Request

getDateHeader

public long getDateHeader(String name)
Description copied from interface: Request
See HttpServletRequest.getDateHeader(String).

Specified by:
getDateHeader in interface Request

getHeader

public String getHeader(String name)
Description copied from interface: Request
See HttpServletRequest.getHeader(String).

Specified by:
getHeader in interface Request

getHeaderNames

public Enumeration getHeaderNames()
Description copied from interface: Request
See HttpServletRequest.getHeaderNames().

Specified by:
getHeaderNames in interface Request

getHeaders

public Enumeration getHeaders(String name)
Description copied from interface: Request
See HttpServletRequest.getHeaders(String).

Specified by:
getHeaders in interface Request

getIntHeader

public int getIntHeader(String name)
Description copied from interface: Request
See HttpServletRequest.getIntHeader(String).

Specified by:
getIntHeader in interface Request

getLocale

public Locale getLocale()
Description copied from interface: Request
See ServletRequest.getLocale().

Specified by:
getLocale in interface Request

getLocales

public Enumeration getLocales()
Description copied from interface: Request
See ServletRequest.getLocales().

Specified by:
getLocales in interface Request

getProtocol

public String getProtocol()
Description copied from interface: Request
See ServletRequest.getProtocol().

Specified by:
getProtocol in interface Request

getRemoteAddr

public String getRemoteAddr()
Description copied from interface: Request
See ServletRequest.getRemoteAddr().

Specified by:
getRemoteAddr in interface Request

getRemoteUser

public String getRemoteUser()
Description copied from interface: Request
See HttpServletRequest.getRemoteUser().

Specified by:
getRemoteUser in interface Request

getRemoteHost

public String getRemoteHost()
Description copied from interface: Request
See ServletRequest.getRemoteHost().

Specified by:
getRemoteHost in interface Request

getRequestDispatcher

public RequestDispatcher getRequestDispatcher(String url)
Description copied from interface: Request
See ServletRequest.getRequestDispatcher(String).

Specified by:
getRequestDispatcher in interface Request

getSession

public HttpSession getSession()
Description copied from interface: Request
See HttpServletRequest.getSession().

Specified by:
getSession in interface Request

getSession

public HttpSession getSession(boolean create)
Description copied from interface: Request
See HttpServletRequest.getSession(boolean).

Specified by:
getSession in interface Request

getServerPort

public int getServerPort()
Description copied from interface: Request
See ServletRequest.getServerPort().

Specified by:
getServerPort in interface Request

getScheme

public String getScheme()
Description copied from interface: Request
See ServletRequest.getScheme().

Specified by:
getScheme in interface Request

getServerName

public String getServerName()
Description copied from interface: Request
See ServletRequest.getServerName().

Specified by:
getServerName in interface Request

getContextPath

public String getContextPath()
Description copied from interface: Request
See HttpServletRequest.getContextPath().

Specified by:
getContextPath in interface Request

isSecure

public boolean isSecure()
Description copied from interface: Request
See ServletRequest.isSecure().

Specified by:
isSecure in interface Request

removeAttribute

public void removeAttribute(String name)
Description copied from interface: Request
See ServletRequest.removeAttribute(String).

Specified by:
removeAttribute in interface Request

setAttribute

public void setAttribute(String name,
                         Object object)
Description copied from interface: Request
See ServletRequest.setAttribute(String, Object).

Specified by:
setAttribute in interface Request

getServerRootUrl

public String getServerRootUrl(int port)
Description copied from interface: Request
Returns the root URL of the server that is running this web applications.

This includes the protocol, the server name and the server port, for example: http://www.somehost.com:8080.

Specified by:
getServerRootUrl in interface Request
Returns:
the server's root url

getHttpServletRequest

public HttpServletRequest getHttpServletRequest()
Description copied from interface: Request
Retrieves the underlying HttpServletRequest.

Specified by:
getHttpServletRequest in interface Request
Returns:
the underlying HttpServletRequest instance; or

null if this request isn't backed by HttpServletRequest



Copyright © 2001-2007 Uwyn sprl/bvba. All Rights Reserved.