// System.err.println(license);
if (license.exists() && user != null && !user.equals("")) {
try {
model.read(new FileInputStream(license), null);
QueryExecution qexec = QueryExecutionFactory.create(
queryString, model);
try {
ResultSet results = qexec.execSelect();
while (results.hasNext()) {
QuerySolution soln = results.nextSolution();
try {
Literal u = soln.getLiteral("user");
// System.err.println("user: "+u.getString());
Literal s = soln.getLiteral("software");
// System.err.println("software: "+s);
Calendar d = ((XSDDateTime) soln.getLiteral("date")
.getValue()).asCalendar();
// System.err.println("date: "+d);
if (u.getString().equals(user)
&& s.getString().equals(software)
&& d.before(Calendar.getInstance())) {
return true;
}
} catch (JenaException e) {
// ignore
} catch (ClassCastException e) {
System.err.println(e.getMessage());
}
}
} finally {
qexec.close();
}
} catch (FileNotFoundException e) {
}
}