|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.servlet.ServletRequestWrapper
javax.servlet.http.HttpServletRequestWrapper
org.silverpeas.servlet.HttpRequest
public class HttpRequest
An HTTP request decorating an HTTP servlet request with some additional methods and by changing
the implementation of some of its methods to take into account some Silverpeas specificities or
needs. For example, the getParameter(java.lang.String)
method has been modified to
take into account also the parameters passed in a multipart/form-data stream.
Field Summary |
---|
Fields inherited from interface javax.servlet.http.HttpServletRequest |
---|
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH |
Method Summary | ||
---|---|---|
static HttpRequest |
decorate(javax.servlet.http.HttpServletRequest request)
Decorates the specified HTTP servlet request with an HttpRequest instance. |
|
static HttpRequest |
decorate(javax.servlet.ServletRequest request)
Decorates the specified servlet request with an HttpRequest instance. |
|
Long |
getAttributeAsLong(String attributeName)
Get a parameter value as a Long. |
|
String |
getCharacterEncoding()
|
|
org.apache.commons.fileupload.FileItem |
getFile(String name)
Processes an RFC 1867 compliant multipart/form-data stream and returns the item whose the type is a file and the name matches the specified one. |
|
org.apache.commons.fileupload.FileItem |
getFileItem(String name)
Processes an RFC 1867 compliant multipart/form-data stream and returns the item whose the name matches the specified one. |
|
List<org.apache.commons.fileupload.FileItem> |
getFileItems()
Processes an RFC 1867 compliant multipart/form-data stream. |
|
MainSessionController |
getMainSessionController()
Gets the main controller in the current user session. |
|
String |
getParameter(String name)
Returns the value of a request parameter as a String, or null if the parameter does not exist. |
|
boolean |
getParameterAsBoolean(String parameterName)
Get a parameter value as a boolean. |
|
Date |
getParameterAsDate(String dateParameterName)
Get a date from a date parameter. |
|
Date |
getParameterAsDate(String dateParameterName,
String hourParameterName)
Get a date from one date parameter and one hour parameter. |
|
|
getParameterAsEnum(String enumValue,
Class<ENUM> enumClass)
Get an enum instance from one parameter. |
|
Integer |
getParameterAsInteger(String parameterName)
Get a parameter value as a Integer. |
|
Long |
getParameterAsLong(String parameterName)
Get a parameter value as a Long. |
|
RequestFile |
getParameterAsRequestFile(String parameterName)
Get a parameter value as a RequestFile . |
|
Map<String,String[]> |
getParameterMap()
Returns a java.util.Map of the parameters of this request. |
|
Enumeration<String> |
getParameterNames()
Returns an Enumeration of String objects containing the names of the parameters contained in this request. |
|
String[] |
getParameterValues(String name)
Returns an array of String objects containing all of the values the given request parameter has, or null if the parameter does not exist. |
|
int |
getServerPort()
|
|
org.apache.commons.fileupload.FileItem |
getSingleFile()
Processes an RFC 1867 compliant multipart/form-data stream and returns the item whose the type is a file. |
|
Collection<UploadedFile> |
getUploadedFiles()
Retrieves from HttpServletRequest a collection of UploadedFile . |
|
String |
getUserLanguage()
Gets the language of the user behind this request. |
|
boolean |
hasCookie(String name)
Is this request has a cookie with the specified name? |
|
boolean |
isContentInMultipart()
Is the content in this request is encoded in a multipart stream. |
|
boolean |
isSecure()
|
|
boolean |
isWithinAnonymousUserSession()
Is this request within an anonymous user session? |
|
boolean |
isWithinUserSession()
Is this request within an opened user session? |
Methods inherited from class javax.servlet.http.HttpServletRequestWrapper |
---|
authenticate, getAuthType, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getIntHeader, getMethod, getPart, getParts, getPathInfo, getPathTranslated, getQueryString, getRemoteUser, getRequestedSessionId, getRequestURI, getRequestURL, getServletPath, getSession, getSession, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isUserInRole, login, logout |
Methods inherited from class javax.servlet.ServletRequestWrapper |
---|
getAsyncContext, getAttribute, getAttributeNames, getContentLength, getContentType, getDispatcherType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequest, getRequestDispatcher, getScheme, getServerName, getServletContext, isAsyncStarted, isAsyncSupported, isWrapperFor, isWrapperFor, removeAttribute, setAttribute, setCharacterEncoding, setRequest, startAsync, startAsync |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.servlet.ServletRequest |
---|
getAsyncContext, getAttribute, getAttributeNames, getContentLength, getContentType, getDispatcherType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getScheme, getServerName, getServletContext, isAsyncStarted, isAsyncSupported, removeAttribute, setAttribute, setCharacterEncoding, startAsync, startAsync |
Method Detail |
---|
public static HttpRequest decorate(javax.servlet.http.HttpServletRequest request)
request
- the Http servlet request to decorate.
public static HttpRequest decorate(javax.servlet.ServletRequest request)
request
- the servlet request to decorate. Must be of type HttpServletRequest.
public boolean isWithinAnonymousUserSession()
public boolean isWithinUserSession()
public List<org.apache.commons.fileupload.FileItem> getFileItems()
public org.apache.commons.fileupload.FileItem getFileItem(String name)
name
- the name of the data to fetch.
public org.apache.commons.fileupload.FileItem getFile(String name)
name
- the name of the file item to fetch.
public org.apache.commons.fileupload.FileItem getSingleFile()
public boolean hasCookie(String name)
name
- the name of the cookie.
public int getServerPort()
getServerPort
in interface javax.servlet.ServletRequest
getServerPort
in class javax.servlet.ServletRequestWrapper
public boolean isSecure()
isSecure
in interface javax.servlet.ServletRequest
isSecure
in class javax.servlet.ServletRequestWrapper
public MainSessionController getMainSessionController()
public String getUserLanguage()
public Collection<UploadedFile> getUploadedFiles()
HttpServletRequest
a collection of UploadedFile
.
UploadedFile
. Empty collection if no uploaded file exists.public Long getAttributeAsLong(String attributeName)
attributeName
- the name of the attribute.
public String[] getParameterValues(String name)
getParameterValues
in interface javax.servlet.ServletRequest
getParameterValues
in class javax.servlet.ServletRequestWrapper
name
- the name of the parameter whose value is requested.
public Enumeration<String> getParameterNames()
getParameterNames
in interface javax.servlet.ServletRequest
getParameterNames
in class javax.servlet.ServletRequestWrapper
public Map<String,String[]> getParameterMap()
getParameterMap
in interface javax.servlet.ServletRequest
getParameterMap
in class javax.servlet.ServletRequestWrapper
public String getParameter(String name)
getParameter
in interface javax.servlet.ServletRequest
getParameter
in class javax.servlet.ServletRequestWrapper
name
- the name of the parameter.
public RequestFile getParameterAsRequestFile(String parameterName)
RequestFile
.
parameterName
- the name of the parameter.
RequestFile
.public boolean getParameterAsBoolean(String parameterName)
parameterName
- the name of the parameter.
public Long getParameterAsLong(String parameterName)
parameterName
- the name of the parameter.
public Integer getParameterAsInteger(String parameterName)
parameterName
- the name of the parameter.
public Date getParameterAsDate(String dateParameterName) throws ParseException
dateParameterName
- the name of the parameter.
ParseException
- if the parameter value isn't a date.public Date getParameterAsDate(String dateParameterName, String hourParameterName) throws ParseException
dateParameterName
- the name of the date parameter.hourParameterName
- the name of the time parameter.
ParseException
- if the parameter value isn't a date.public <ENUM extends Enum> ENUM getParameterAsEnum(String enumValue, Class<ENUM> enumClass)
ENUM
- the type of the expected enum instance.enumValue
- the string value of the expected enum instance.enumClass
- the class of the expected enum instance.
public boolean isContentInMultipart()
public String getCharacterEncoding()
getCharacterEncoding
in interface javax.servlet.ServletRequest
getCharacterEncoding
in class javax.servlet.ServletRequestWrapper
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |