Class TrellisRequest


  • public class TrellisRequest
    extends Object
    A class representing an HTTP request with various LDP-related headers and query parameters.
    • Constructor Detail

      • TrellisRequest

        public TrellisRequest​(Request request,
                              UriInfo uriInfo,
                              HttpHeaders headers)
        Bundle together some request contexts.
        Parameters:
        request - the Request object
        uriInfo - the URI information
        headers - the HTTP headers
      • TrellisRequest

        public TrellisRequest​(Request request,
                              UriInfo uriInfo,
                              HttpHeaders headers,
                              SecurityContext secCtx)
        Bundle together some request contexts.
        Parameters:
        request - the Request object
        uriInfo - the URI information
        headers - the HTTP headers
        secCtx - the security context
    • Method Detail

      • getContentType

        public String getContentType()
        Get the Content-Type header.
        Returns:
        the Content-Type header
      • getSlug

        public String getSlug()
        Get the slug header.
        Returns:
        the decoded value of the slug header
      • getLink

        public Link getLink()
        Get the Link header.
        Returns:
        the Link header
      • getDatetime

        public AcceptDatetime getDatetime()
        Get the Accept-Datetime value.
        Returns:
        the accept-datetime header
      • getPrefer

        public Prefer getPrefer()
        Get the prefer header.
        Returns:
        the Prefer header
      • getRange

        public Range getRange()
        Get the range header.
        Returns:
        the range header
      • getPath

        public String getPath()
        Get the path.

        This method returns a normalized resource path for use with internal identifiers. That means that any trailing slash will not be present. Please see the hasTrailingSlash() method to check for a trailing slash.

        Returns:
        the normalized path
      • hasTrailingSlash

        public boolean hasTrailingSlash()
        Test whether the path has a trailing slash.
        Returns:
        true if the request path ends in a slash
      • getVersion

        public Version getVersion()
        Get the version value.
        Returns:
        the version query parameter
      • getExt

        public String getExt()
        Get the ext value.
        Returns:
        the ext query parameter
      • getBaseUrl

        public String getBaseUrl()
        Get a base url value.
        Returns:
        the baseUrl as a string
      • getSecurityContext

        public SecurityContext getSecurityContext()
        Get the security context.
        Returns:
        the security context
      • getMethod

        public String getMethod()
        Get the HTTP method.
        Returns:
        the method name
      • getAcceptableMediaTypes

        public List<MediaType> getAcceptableMediaTypes()
        Get the HTTP headers.
        Returns:
        the http headers