use of org.apache.jena.riot.system.stream.LocatorFile in project jena by apache.
the class TestLocators method locatorFile_01.
@Test
public void locatorFile_01() {
LocatorFile loc = new LocatorFile();
assertTrue(loc.exists("pom.xml"));
assertTrue(loc.exists(testingDir + "data.ttl"));
assertFalse(loc.exists("IDoNotExist"));
}
use of org.apache.jena.riot.system.stream.LocatorFile in project jena by apache.
the class TestLocators method locatorFile_03.
@Test
public void locatorFile_03() {
String dir = new File(".").getAbsolutePath();
LocatorFile loc = new LocatorFile(dir);
assertTrue(loc.exists("pom.xml"));
assertFalse(loc.exists("IDoNotExist"));
}
use of org.apache.jena.riot.system.stream.LocatorFile in project jena by apache.
the class TestRDFParser method source_streamManager.
@Test
public void source_streamManager() {
StreamManager sMgr = new StreamManager();
sMgr.addLocator(new LocatorFile(DIR));
Graph graph = GraphFactory.createGraphMem();
RDFParser.create().streamManager(sMgr).source("file:data.rdf").forceLang(Lang.TTL).parse(graph);
assertEquals(3, graph.size());
}
use of org.apache.jena.riot.system.stream.LocatorFile in project jena by apache.
the class TestLocators method locatorFile_04.
@Test
public void locatorFile_04() {
String dir = new File("src").getAbsolutePath();
LocatorFile loc = new LocatorFile(dir);
assertFalse(loc.exists("pom.xml"));
assertTrue(loc.exists("main"));
assertFalse(loc.exists(testingDir + "data.ttl"));
assertTrue(loc.exists("../pom.xml"));
assertFalse(loc.exists("/../" + testingDir + "data.ttl"));
}
use of org.apache.jena.riot.system.stream.LocatorFile in project jena by apache.
the class TestLocators method locatorFile_05.
@Test
public void locatorFile_05() {
LocatorFile loc = new LocatorFile();
TypedInputStream ts = loc.open(testingDir + "data.ttl");
assertTrue("Not equal: " + WebContent.contentTypeTurtle + " != " + ts.getMediaType(), WebContent.contentTypeTurtle.equalsIgnoreCase(ts.getContentType()));
}
Aggregations