public class ActionLib extends Object
Operations related to servlets
  • Constructor Details

    • ActionLib

      public ActionLib()
  • Method Details

    • mapRequestToEndpointName

      public static String mapRequestToEndpointName(HttpAction action, DataAccessPoint dataAccessPoint)
      Calculate the operation, given action and data access point
    • mapRequestToEndpointName

      public static String mapRequestToEndpointName(String uri, DataAccessPoint dataAccessPoint)
      Calculate the operation, given request URI and data access point
    • unused_mapRequestToDatasetLongest

      public static String unused_mapRequestToDatasetLongest(String uri, DataAccessPointRegistry registry)
      Implementation of mapRequestToDataset(String) that looks for the longest match in the registry. This includes use in direct naming GSP.
    • wholeRequestURL

      public static String wholeRequestURL(javax.servlet.http.HttpServletRequest request)
      Calculate the full URL including query string for the HTTP request. This may be quite long.
      request - HttpServletRequest
      String The full URL, including query string.
    • removeContextPath

      public static String removeContextPath(HttpAction action)
    • actionURI

      public static String actionURI(javax.servlet.http.HttpServletRequest request)
      the URI without context path of the webapp and without query string.
    • contentNegotation

      public static MediaType contentNegotation(HttpAction action, AcceptList myPrefs, MediaType defaultMediaType)
      Negotiate the content-type and set the response headers
    • contentNegotationRDF

      public static MediaType contentNegotationRDF(HttpAction action)
      Negotiate the content-type for an RDF triples syntax and set the response headers
    • contentNegotationQuads

      public static MediaType contentNegotationQuads(HttpAction action)
      Negotiate the content-type for an RDF quads syntax and set the response headers
    • splitOnComma

      public static String[] splitOnComma(String string)
      Split a string on "," and remove leading and trailing whitespace on each element
    • splitContains

      public static boolean splitContains(String[] elts, String str)
    • parseOrError

      public static void parseOrError(HttpAction action, StreamRDF dest, Lang lang, String base)
      Parse RDF content from the body of the request of the action, ends the request, and sends a 400 if there is a parse error.
    • parse

      public static void parse(HttpAction action, StreamRDF dest, Lang lang, String base)
      Parse RDF content. This wraps up the parse step reading from an action. It includes handling compression if the Content-Encoding header is present
    • parse

      public static void parse(HttpAction action, StreamRDF dest, InputStream input, Lang lang, String base)
      Parse RDF content. This wraps up the parse step reading from an input stream.
    • consumeBody

      public static void consumeBody(HttpAction action)
      Reset the request input stream for an HttpAction if necessary. If there is a Content-Length header, throw away input to exhaust this request. If there is a no Content-Length header, no need to do anything - the connection is not reusable.
    • readFromRequest

      public static Graph readFromRequest(HttpAction action, Lang defaultLang)
    • datasetResponse

      public static void datasetResponse(HttpAction action, DatasetGraph dsg, Lang lang)
      Output a dataset to the HTTP response.
    • datasetResponse

      public static void datasetResponse(HttpAction action, DatasetGraph dsg, RDFFormat format, String contentType)
      Output a dataset to the HTTP response.
    • graphResponse

      public static void graphResponse(HttpAction action, Graph graph, Lang lang)
      Output a graph to the HTTP response. Bad, unwritable RDF/XML causes a "406 Not Acceptable".
    • graphResponse

      public static void graphResponse(HttpAction action, Graph graph, RDFFormat format, String contentType)
      Output a graph to the HTTP response. Bad, unwritable RDF/XML causes a "406 Not Acceptable".
    • getNetworkFormatForLang

      public static RDFFormat getNetworkFormatForLang(Lang lang)
      Return the preferred RDFFormat for a given Lang.
    • getOneHeader

      public static String getOneHeader(javax.servlet.http.HttpServletRequest request, String name)
      Get one or zero strings from an HTTP header
    • getContentType

      public static ContentType getContentType(HttpAction action)
      Get the content type of an action.
      action -
    • setCommonHeadersForOptions

      public static void setCommonHeadersForOptions(HttpAction action)
    • setCommonHeaders

      public static void setCommonHeaders(HttpAction action)
    • doOptionsGet

      public static void doOptionsGet(HttpAction action)
    • doOptionsGetHead

      public static void doOptionsGetHead(HttpAction action)
    • doOptionsGetPost

      public static void doOptionsGetPost(HttpAction action)
    • doOptionsGetPostHead

      public static void doOptionsGetPostHead(HttpAction action)
    • doOptionsGetPostDelete

      public static void doOptionsGetPostDelete(HttpAction action)
    • doOptionsGetPostDeleteHead

      public static void doOptionsGetPostDeleteHead(HttpAction action)
    • doOptionsPost

      public static void doOptionsPost(HttpAction action)