DatabaseRepresentation { public long getLastRevision(final String resourceName) throws JaxRxException, SirixException { long lastRevision; if (WorkerHelper.checkExistingResource(mStoragePath, resourceName)) { Database database = Databases.openDatabase(mStoragePath); NodeReadTrx rtx = null; Session session = null; try { session = database.getSession(new SessionConfiguration.Builder( resourceName).build()); lastRevision = session.getMostRecentRevisionNumber(); } catch (final Exception globExcep) { throw new JaxRxException(globExcep); } finally { WorkerHelper.closeRTX(rtx, session, database); } } else { throw new JaxRxException(404, "Resource not found"); } return lastRevision; } DatabaseRepresentation(final File storagePath); void createResource(final InputStream inputStream,
			final String resourceName); StreamingOutput getResource(final String resourceName,
			final Map<QueryParameter, String> queryParams); StreamingOutput performQueryOnResource(final String resource,
			final String query, final Map<QueryParameter, String> otherParams); StreamingOutput getResourcesNames(); boolean add(final InputStream input, final String resource); void deleteResource(final String resourceName); final boolean shred(final InputStream xmlInput, final String resource); long getLastRevision(final String resourceName); OutputStream getModificHistory(
			final String resourceName, // NOPMD this method needs alls these
			// functions
			final String revisionRange, final boolean nodeid,
			final OutputStream output, final boolean wrap); void revertToRevision(final String resourceName,
			final int backToRevision);  }
@Test public void getLastRevision() throws SirixException { assertEquals(ASSEQUALS, 1, sirix.getLastRevision(RESOURCENAME)); final NodeIdRepresentation rid = new NodeIdRepresentation( TestHelper.PATHS.PATH1.getFile()); rid.deleteResource(RESOURCENAME, 8); assertEquals(ASSEQUALS, 2, sirix.getLastRevision(RESOURCENAME)); }