use of org.apache.jena.shared.NotFoundException in project webofneeds by researchstudio-sat.
the class GoalUtils method loadSparqlQuery.
private static String loadSparqlQuery(String filePath) {
InputStream is = GoalUtils.class.getResourceAsStream(filePath);
StringWriter writer = new StringWriter();
try {
IOUtils.copy(is, writer, Charsets.UTF_8);
} catch (IOException e) {
throw new NotFoundException("failed to load resource: " + filePath);
} finally {
try {
is.close();
} catch (Exception e) {
}
}
return writer.toString();
}
use of org.apache.jena.shared.NotFoundException in project webofneeds by researchstudio-sat.
the class GoalInstantiationTest method loadSparqlQuery.
private static String loadSparqlQuery(String filePath) {
InputStream is = GoalInstantiationTest.class.getResourceAsStream(filePath);
StringWriter writer = new StringWriter();
try {
IOUtils.copy(is, writer, Charsets.UTF_8);
} catch (IOException e) {
throw new NotFoundException("failed to load resource: " + filePath);
} finally {
try {
is.close();
} catch (Exception e) {
}
}
return writer.toString();
}
Aggregations