/** * Handle repository exceptions in a uniform way. The output will we written to the logger of the ExceptionUtils * class. * * @param ex */ public static void handleRepositoryException(RepositoryException ex) { handleRepositoryException(ex,null); }
/** * Handle repository exceptions in a uniform way. The output will we written to the logger of the ExceptionUtils * class. * * @param ex */ public static void handleRepositoryException(RepositoryException ex) { handleRepositoryException(ex,null); }
@Override public void remove() { try { result.remove(); } catch (RepositoryException e) { handleRepositoryException(e, ResourceUtils.class); } }
@Override public void remove() { try { result.remove(); } catch (RepositoryException e) { handleRepositoryException(e, ResourceUtils.class); } }
@Override public boolean hasNext() { if(result.isClosed()) { return false; } try { return result.hasNext(); } catch (RepositoryException e) { ExceptionUtils.handleRepositoryException(e, ResourceUtils.class); return false; } }
@Override public boolean hasNext() { if(result.isClosed()) { return false; } try { return result.hasNext(); } catch (RepositoryException e) { ExceptionUtils.handleRepositoryException(e, ResourceUtils.class); return false; } }
@Override public Iterator<Statement> iterator() { try { return ResultUtils.unwrap(con.getStatements(r, property, null, true, contexts)); } catch (RepositoryException ex) { ExceptionUtils.handleRepositoryException(ex, ResourceUtils.class); return Iterators.emptyIterator(); } } };
@Override public Iterator<Resource> iterator() { try { return ResultUtils.unwrap(rcon.getResources()); } catch (RepositoryException e) { ExceptionUtils.handleRepositoryException(e,ResourceUtils.class); return Iterators.emptyIterator(); } } };
@Override public Iterator<Statement> iterator() { try { return ResultUtils.unwrap(con.getStatements(r, property, null, true, contexts)); } catch (RepositoryException ex) { ExceptionUtils.handleRepositoryException(ex, ResourceUtils.class); return Iterators.emptyIterator(); } } };
@Override public Iterator<Statement> iterator() { try { return ResultUtils.unwrap(con.getStatements(r,rdf_type,null,true,contexts)); } catch (RepositoryException e) { ExceptionUtils.handleRepositoryException(e, ResourceUtils.class); return Iterators.emptyIterator(); } } },
@Override public T next() { try { T next = result.next(); if(!result.hasNext()) { result.close(); } return next; } catch (RepositoryException e) { handleRepositoryException(e, ResourceUtils.class); return null; } }
@Override public Iterator<Statement> iterator() { try { return ResultUtils.unwrap(con.getStatements(null, property, r, true, contexts)); } catch (RepositoryException ex) { ExceptionUtils.handleRepositoryException(ex, ResourceUtils.class); return Iterators.emptyIterator(); } } };
@Override public Iterator<Statement> iterator() { try { return ResultUtils.unwrap(con.getStatements(r,rdf_type,null,true,contexts)); } catch (RepositoryException e) { ExceptionUtils.handleRepositoryException(e, ResourceUtils.class); return Iterators.emptyIterator(); } } },
@Override public Iterator<Resource> iterator() { try { return ResultUtils.unwrap(rcon.getResources()); } catch (RepositoryException e) { ExceptionUtils.handleRepositoryException(e,ResourceUtils.class); return Iterators.emptyIterator(); } } };
@Override public Iterator<Statement> iterator() { try { return ResultUtils.unwrap(con.getStatements(null, property, r, true, contexts)); } catch (RepositoryException ex) { ExceptionUtils.handleRepositoryException(ex, ResourceUtils.class); return Iterators.emptyIterator(); } } };
@Override public T next() { try { T next = result.next(); if(!result.hasNext()) { result.close(); } return next; } catch (RepositoryException e) { handleRepositoryException(e, ResourceUtils.class); return null; } }
@Override public Iterator<URI> iterator() { try { Iterator<URI> result = ResultUtils.unwrap(rcon.getResources(prefix)); Iterators.advance(result,offset); if(limit > 0) { return Iterators.limit(result,limit); } else { return result; } } catch (RepositoryException e) { ExceptionUtils.handleRepositoryException(e,ResourceUtils.class); return Iterators.emptyIterator(); } } };
@Override public Iterator<URI> iterator() { try { Iterator<URI> result = ResultUtils.unwrap(rcon.getResources(prefix)); Iterators.advance(result,offset); if(limit > 0) { return Iterators.limit(result,limit); } else { return result; } } catch (RepositoryException e) { ExceptionUtils.handleRepositoryException(e,ResourceUtils.class); return Iterators.emptyIterator(); } } };
@Override public URI getContext(String context_uri) { try { RepositoryConnection conn = sesameService.getConnection(); try { conn.begin(); checkConnectionNamespace(conn); if (ResourceUtils.isContext(conn, context_uri)) return conn.getValueFactory().createURI(context_uri); } finally { conn.commit(); conn.close(); } } catch(RepositoryException ex) { handleRepositoryException(ex, ContextServiceImpl.class); } return null; }
@Override public URI getContext(String context_uri) { try { RepositoryConnection conn = sesameService.getConnection(); try { conn.begin(); checkConnectionNamespace(conn); if (ResourceUtils.isContext(conn, context_uri)) return conn.getValueFactory().createURI(context_uri); } finally { conn.commit(); conn.close(); } } catch(RepositoryException ex) { handleRepositoryException(ex, ContextServiceImpl.class); } return null; }