Search in sources :

Example 11 with FusekiConfigException

use of org.apache.jena.fuseki.FusekiConfigException in project jena by apache.

the class FusekiServer method writeableDirectory.

private static Path writeableDirectory(Path root, String relName) {
    Path p = makePath(root, relName);
    ensureDir(p);
    if (!Files.isWritable(p))
        throw new FusekiConfigException("Not writable: " + p);
    return p;
}
Also used : Path(java.nio.file.Path) FusekiConfigException(org.apache.jena.fuseki.FusekiConfigException)

Example 12 with FusekiConfigException

use of org.apache.jena.fuseki.FusekiConfigException in project jena by apache.

the class FusekiConfig method getOne.

private static RDFNode getOne(Resource svc, String property) {
    String ln = property.substring(property.indexOf(':') + 1);
    ResultSet rs = query("SELECT * { ?svc " + property + " ?x}", svc.getModel(), "svc", svc);
    if (!rs.hasNext())
        throw new FusekiConfigException("No " + ln + " for service " + nodeLabel(svc));
    RDFNode x = rs.next().get("x");
    if (rs.hasNext())
        throw new FusekiConfigException("Multiple " + ln + " for service " + nodeLabel(svc));
    return x;
}
Also used : FusekiConfigException(org.apache.jena.fuseki.FusekiConfigException)

Aggregations

FusekiConfigException (org.apache.jena.fuseki.FusekiConfigException)12 Path (java.nio.file.Path)3 IOException (java.io.IOException)2 Method (java.lang.reflect.Method)2 RDFNode (org.apache.jena.rdf.model.RDFNode)2 InputStream (java.io.InputStream)1 URL (java.net.URL)1 ArrayList (java.util.ArrayList)1 DataAccessPoint (org.apache.jena.fuseki.server.DataAccessPoint)1 DataService (org.apache.jena.fuseki.server.DataService)1 Dataset (org.apache.jena.query.Dataset)1 ResultSet (org.apache.jena.query.ResultSet)1 Literal (org.apache.jena.rdf.model.Literal)1