DatabaseStorageService implements StorageService { @SneakyThrows @Override public boolean objectExists(AbsoluteLocation location) { ParsedLocation parsed = new ParsedLocation(location, allowedTables); String sql = "SELECT COUNT(*) FROM " + parsed.getTableName() + " WHERE `key` = ?"; return 0 != conn.jdbcTemplate(location).queryForObject(sql, Integer.class, parsed.getPathWithUser()); }  @SneakyThrows @Override boolean objectExists(AbsoluteLocation location); @SneakyThrows @Override Stream<AbsoluteLocation<ResolvedResource>> list(AbsoluteLocation location); @SneakyThrows @Override InputStream read(AbsoluteLocation location); @SneakyThrows @Override void remove(AbsoluteLocation location); @SneakyThrows @Override OutputStream write(WithCallback<AbsoluteLocation, ? extends ResourceWriteCallback> locationWithCallback);  }
@Test void objectExists() { assertThat(storageService.objectExists(FILE)).isTrue(); }