Class WebScriptServletRequest

    • Constructor Detail

      • WebScriptServletRequest

        public WebScriptServletRequest​(Runtime container,
                                       javax.servlet.http.HttpServletRequest req,
                                       Match serviceMatch,
                                       ServerProperties serverProperties)
        Construction
        Parameters:
        container - request generator
        req - HttpServletRequest
        serviceMatch - Match
        serverProperties - ServerProperties
    • Method Detail

      • getHttpServletRequest

        public javax.servlet.http.HttpServletRequest getHttpServletRequest()
        Gets the HTTP Servlet Request
        Returns:
        HTTP Servlet Request
      • getServiceMatch

        public Match getServiceMatch()
        Description copied from interface: WebScriptRequest
        Gets the matching API Service for this request
        Returns:
        the service match
      • getServerPath

        public java.lang.String getServerPath()
        Description copied from interface: WebScriptRequest
        Get server portion of the request e.g. scheme://host:port
        Returns:
        server path
      • getContextPath

        public java.lang.String getContextPath()
        Description copied from interface: WebScriptRequest
        Gets the Alfresco Context Path
        Returns:
        context url e.g. /alfresco
      • getServiceContextPath

        public java.lang.String getServiceContextPath()
        Description copied from interface: WebScriptRequest
        Gets the Alfresco Web Script Context Path
        Returns:
        service url e.g. /alfresco/service
      • getServicePath

        public java.lang.String getServicePath()
        Description copied from interface: WebScriptRequest
        Gets the Alfresco Service Path
        Returns:
        service url e.g. /alfresco/service/search/keyword
      • getURL

        public java.lang.String getURL()
        Description copied from interface: WebScriptRequest
        Gets the full request URL
        Returns:
        request url e.g. /alfresco/service/search/keyword?q=term
      • getPathInfo

        public java.lang.String getPathInfo()
        Description copied from interface: WebScriptRequest
        Gets the service specific path
        Returns:
        request path e.g. /search/keyword
      • getQueryString

        public java.lang.String getQueryString()
        Description copied from interface: WebScriptRequest
        Gets the query String
        Returns:
        query string e.g. q=alfresco&format=atom
      • getParameterNames

        public java.lang.String[] getParameterNames()
        Description copied from interface: WebScriptRequest
        Gets the names of all parameters on the Url
        Returns:
        the names (empty, if none)
      • getParameter

        public java.lang.String getParameter​(java.lang.String name)
        Description copied from interface: WebScriptRequest
        Gets the value of the named parameter
        Parameters:
        name - parameter name
        Returns:
        parameter value (or null, if parameter does not exist)
      • getParameterValues

        public java.lang.String[] getParameterValues​(java.lang.String name)
        Description copied from interface: WebScriptRequest
        Gets the (array) value of the named parameter Note: An array of one item is returned when a "single value" named parameter is requested
        Parameters:
        name - parameter name
        Returns:
        array of values (or null, if parameter does not exist)
      • getHeaderNames

        public java.lang.String[] getHeaderNames()
        Description copied from interface: WebScriptRequest
        Gets the names of all headers for this request
        Returns:
        the names (empty, if none)
      • getHeader

        public java.lang.String getHeader​(java.lang.String name)
        Description copied from interface: WebScriptRequest
        Gets the value of the named header
        Parameters:
        name - header name
        Returns:
        header value (or null, if header does not exist)
      • getHeaderValues

        public java.lang.String[] getHeaderValues​(java.lang.String name)
        Description copied from interface: WebScriptRequest
        Gets the (array) value of the named header Note: An array of one item is returned when a "single value" named header is requested
        Parameters:
        name - header name
        Returns:
        array of values (or null, if header does not exist)
      • getAgent

        public java.lang.String getAgent()
        Description copied from interface: WebScriptRequest
        Get User Agent TODO: Expand on known agents
        Returns:
        MSIE / Firefox
      • resolveUserAgent

        public static java.lang.String resolveUserAgent​(java.lang.String userAgent)
        Helper to resolve common user agent strings from Http request header
      • getContent

        public org.springframework.extensions.surf.util.Content getContent()
        Description copied from interface: WebScriptRequest
        Gets the request body as content
        Returns:
        request content (or null, if none)
      • getFileField

        public FormData.FormField getFileField​(java.lang.String name)
        Returns the FormField bject representing a file uploaded via a multipart form.
        Parameters:
        name - The name of the field containing the content
        Returns:
        FormField bject representing a file uploaded via a multipart form or null if the field does not exist or is not a file field.
      • forceSuccessStatus

        public boolean forceSuccessStatus()
        Description copied from interface: WebScriptRequest
        Force response to return SUCCESS (200) code Note: This is to support clients who cannot support non-success codes e.g. Flash player
        Specified by:
        forceSuccessStatus in interface WebScriptRequest
        Overrides:
        forceSuccessStatus in class WebScriptRequestImpl
        Returns:
        true => force return of 200, otherwise return status explicitly set
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object