Class SlingHttpServletRequestWrapper

    • Constructor Detail

      • SlingHttpServletRequestWrapper

        public SlingHttpServletRequestWrapper​(SlingHttpServletRequest wrappedRequest)
        Create a wrapper for the supplied wrappedRequest
        Parameters:
        wrappedRequest - The request.
    • Method Detail

      • getCookie

        public Cookie getCookie​(java.lang.String name)
        Description copied from interface: SlingHttpServletRequest
        Returns the named cookie from the HTTP request or null if no such cookie exists in the request.
        Specified by:
        getCookie in interface SlingHttpServletRequest
        Parameters:
        name - The name of the cookie to return.
        Returns:
        The named cookie or null if no such cookie exists.
      • getRequestDispatcher

        public RequestDispatcher getRequestDispatcher​(Resource resource,
                                                      RequestDispatcherOptions options)
        Description copied from interface: SlingHttpServletRequest
        Returns a RequestDispatcher object that acts as a wrapper for the resource located at the given resource. A RequestDispatcher object can be used to include the resource in a response.

        Returns null if a RequestDispatcher cannot be returned for any reason.

        Specified by:
        getRequestDispatcher in interface SlingHttpServletRequest
        Parameters:
        resource - The Resource instance whose response content may be included by the returned dispatcher.
        options - influence the rendering of the included Resource
        Returns:
        a RequestDispatcher object that acts as a wrapper for the resource or null if an error occurs preparing the dispatcher.
      • getRequestDispatcher

        public RequestDispatcher getRequestDispatcher​(java.lang.String path,
                                                      RequestDispatcherOptions options)
        Description copied from interface: SlingHttpServletRequest
        Returns a RequestDispatcher object that acts as a wrapper for the resource located at the given path. A RequestDispatcher object can be used to include the resource in a response.

        Returns null if a RequestDispatcher cannot be returned for any reason.

        Specified by:
        getRequestDispatcher in interface SlingHttpServletRequest
        Parameters:
        path - a String specifying the pathname to the resource. If it is relative, it must be relative against the current servlet.
        options - influence the rendering of the included Resource
        Returns:
        a RequestDispatcher object that acts as a wrapper for the resource or null if an error occurs preparing the dispatcher.
      • getRequestParameterMap

        public RequestParameterMap getRequestParameterMap()
        Description copied from interface: SlingHttpServletRequest
        Returns a Map of the parameters of this request.

        The values in the returned Map are from type RequestParameter array (RequestParameter[]).

        If no parameters exist this method returns an empty Map.

        Specified by:
        getRequestParameterMap in interface SlingHttpServletRequest
        Returns:
        an immutable Map containing parameter names as keys and parameter values as map values, or an empty Map if no parameters exist. The keys in the parameter map are of type String. The values in the parameter map are of type RequestParameter array (RequestParameter[]).
      • getResourceBundle

        public java.util.ResourceBundle getResourceBundle​(java.util.Locale locale)
        Description copied from interface: SlingHttpServletRequest
        Returns the resource bundle for the given locale.
        Specified by:
        getResourceBundle in interface SlingHttpServletRequest
        Parameters:
        locale - the locale for which to retrieve the resource bundle. If this is null, the locale returned by ServletRequest.getLocale() is used to select the resource bundle.
        Returns:
        the resource bundle for the given locale
      • getResourceBundle

        public java.util.ResourceBundle getResourceBundle​(java.lang.String baseName,
                                                          java.util.Locale locale)
        Description copied from interface: SlingHttpServletRequest
        Returns the resource bundle of the given base name for the given locale.
        Specified by:
        getResourceBundle in interface SlingHttpServletRequest
        Parameters:
        baseName - The base name of the resource bundle to returned. If this parameter is null, the same resource bundle must be returned as if the SlingHttpServletRequest.getResourceBundle(Locale) method is called.
        locale - the locale for which to retrieve the resource bundle. If this is null, the locale returned by ServletRequest.getLocale() is used to select the resource bundle.
        Returns:
        the resource bundle for the given locale
      • getResponseContentType

        public java.lang.String getResponseContentType()
        Description copied from interface: SlingHttpServletRequest
        Returns the framework preferred content type for the response. The content type only includes the MIME type, not the character set.

        For included resources this method will returned the same string as returned by the ServletResponse.getContentType() without the character set.

        Specified by:
        getResponseContentType in interface SlingHttpServletRequest
        Returns:
        preferred MIME type of the response
      • getResponseContentTypes

        public java.util.Enumeration<java.lang.String> getResponseContentTypes()
        Description copied from interface: SlingHttpServletRequest
        Gets a list of content types which the framework accepts for the response. This list is ordered with the most preferable types listed first. The content type only includes the MIME type, not the character set.

        For included resources this method will returned an enumeration containing a single entry which is the same string as returned by the ServletResponse.getContentType() without the character set.

        Specified by:
        getResponseContentTypes in interface SlingHttpServletRequest
        Returns:
        ordered list of MIME types for the response
      • adaptTo

        public <AdapterType> AdapterType adaptTo​(java.lang.Class<AdapterType> type)
        Description copied from interface: Adaptable
        Adapts the adaptable to another type.

        Please note that it is explicitly left as an implementation detail whether each call to this method with the same type yields the same object or a new object on each call.

        Implementations of this method should document their adapted types as well as their behaviour with respect to returning newly created or same instances on each call.

        Specified by:
        adaptTo in interface Adaptable
        Type Parameters:
        AdapterType - The generic type to which this object is adapted to
        Parameters:
        type - The Class object of the target type, such as javax.jcr.Node.class or java.io.File.class
        Returns:
        The adapter target or null if the object cannot adapt to the requested type