RepositoryConnection con;
try {
con = repository.getConnection();
try {
ContextResult contexts = con.getContextIDs();
try {
if (contexts.hasNext()) {
writeln("+----------");
while (contexts.hasNext()) {
Resource context = contexts.next();
writeln("|" + context.toString());
}
writeln("+----------");
}
else {
writeln("--no contexts found--");
}
}
finally {
contexts.close();
}
}
finally {
con.close();
}