java.lang.Object
org.apache.jena.fuseki.servlets.ActionLib

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(jakarta.servlet.http.HttpServletRequest request)
      Calculate the full URL including query string for the HTTP request. This may be quite long.
      Parameters:
      request - HttpServletRequest
      Returns:
      String The full URL, including query string.
    • removeContextPath

      public static String removeContextPath(HttpAction action)
    • actionURI

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

      public static org.apache.jena.atlas.web.MediaType contentNegotation(HttpAction action, org.apache.jena.atlas.web.AcceptList myPrefs, org.apache.jena.atlas.web.MediaType defaultMediaType)
      Negotiate the content-type and set the response headers
    • contentNegotationRDF

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

      public static org.apache.jena.atlas.web.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, org.apache.jena.riot.system.StreamRDF dest, org.apache.jena.riot.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.
      Throws:
      ActionErrorException
    • parse

      public static void parse(HttpAction action, org.apache.jena.riot.system.StreamRDF dest, org.apache.jena.riot.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
      Throws:
      org.apache.jena.riot.RiotParseException
    • parse

      public static void parse(HttpAction action, org.apache.jena.riot.system.StreamRDF dest, InputStream input, org.apache.jena.riot.Lang lang, String base)
      Parse RDF content. This wraps up the parse step reading from an input stream.
      Throws:
      org.apache.jena.riot.RiotParseException
    • 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 org.apache.jena.graph.Graph readFromRequest(HttpAction action, org.apache.jena.riot.Lang defaultLang)
    • datasetResponse

      public static void datasetResponse(HttpAction action, org.apache.jena.sparql.core.DatasetGraph dsg, org.apache.jena.riot.Lang lang)
      Output a dataset to the HTTP response.
    • datasetResponse

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

      public static void graphResponse(HttpAction action, org.apache.jena.graph.Graph graph, org.apache.jena.riot.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, org.apache.jena.graph.Graph graph, org.apache.jena.riot.RDFFormat format, String contentType)
      Output a graph to the HTTP response. Bad, unwritable RDF/XML causes a "406 Not Acceptable".
    • getNetworkFormatForLang

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

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

      public static org.apache.jena.atlas.web.ContentType getContentType(HttpAction action)
      Get the content type of an action.
      Parameters:
      action -
      Returns:
      ContentType
    • 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)