private boolean contentExists ( BinaryKey key , boolean alive ) throws BinaryStoreException { try { String query = "SELECT payload from modeshape.binary where cid='" + key . toString ( ) + "'" ; query = alive ? query + " and usage=1;" : query + " and usage = 0;" ; ResultSet rs = session . execute ( query ) ; return rs . iterator ( ) . hasNext ( ) ; } catch ( RuntimeException e ) { throw new BinaryStoreException ( e ) ; } }
Test content for existence .