@Test public void testListRejectsDatasetUri() { TestHelpers.assertThrows("Should reject dataset URI", IllegalArgumentException.class, new Runnable() { @Override public void run() { Datasets.list(new URIBuilder(repoUri, "ns", "test").build()); } }); verifyNoMoreInteractions(repo); }
public static Collection<URI> list(URI uri) { boolean isRepo = URIBuilder.REPO_SCHEME.equals(uri.getScheme()); Preconditions.checkArgument(isRepo, "Not a repository URI: " + uri); DatasetRepository repo = Registration .open(URI.create(uri.getRawSchemeSpecificPart())); URI repoUri = repo.getUri(); List<URI> datasets = Lists.newArrayList(); for (String namespace : repo.namespaces()) { for (String dataset : repo.datasets(namespace)) { datasets.add(new URIBuilder(repoUri, namespace, dataset).build()); } } return datasets; }
Datasets { public static Collection<URI> list(URI uri) { boolean isRepo = URIBuilder.REPO_SCHEME.equals(uri.getScheme()); Preconditions.checkArgument(isRepo, "Not a repository URI: " + uri); DatasetRepository repo = Registration .open(URI.create(uri.getRawSchemeSpecificPart())); URI repoUri = repo.getUri(); List<URI> datasets = Lists.newArrayList(); for (String namespace : repo.namespaces()) { for (String dataset : repo.datasets(namespace)) { datasets.add(new URIBuilder(repoUri, namespace, dataset).build()); } } return datasets; } }
Datasets { public static Collection<URI> list(URI uri) { boolean isRepo = URIBuilder.REPO_SCHEME.equals(uri.getScheme()); Preconditions.checkArgument(isRepo, "Not a repository URI: " + uri); DatasetRepository repo = Registration .open(URI.create(uri.getRawSchemeSpecificPart())); URI repoUri = repo.getUri(); List<URI> datasets = Lists.newArrayList(); for (String namespace : repo.namespaces()) { for (String dataset : repo.datasets(namespace)) { datasets.add(new URIBuilder(repoUri, namespace, dataset).build()); } } return datasets; }  }
Datasets { public static Collection<URI> list(URI uri) { boolean isRepo = URIBuilder.REPO_SCHEME.equals(uri.getScheme()); Preconditions.checkArgument(isRepo, "Not a repository URI: " + uri); DatasetRepository repo = Registration .open(URI.create(uri.getRawSchemeSpecificPart())); URI repoUri = repo.getUri(); List<URI> datasets = Lists.newArrayList(); for (String namespace : repo.namespaces()) { for (String dataset : repo.datasets(namespace)) { datasets.add(new URIBuilder(repoUri, namespace, dataset).build()); } } return datasets; }  @SuppressWarnings("unchecked") static V load(URI uri, Class<E> type); @SuppressWarnings("unchecked") static V load(URI uri); static V load(String uriString, Class<E> type); static V load(String uriString); @SuppressWarnings("unchecked") static V create(URI uri, DatasetDescriptor descriptor, Class<E> type); @SuppressWarnings("unchecked") static V create(URI uri, DatasetDescriptor descriptor); static V create(String uri, DatasetDescriptor descriptor, Class<E> type); @SuppressWarnings("unchecked") static V create(String uri, DatasetDescriptor descriptor); @SuppressWarnings("unchecked") static D update(
      URI uri, DatasetDescriptor descriptor, Class<E> type); @SuppressWarnings("unchecked") static D update(
      URI uri, DatasetDescriptor descriptor); static D update(String uri, DatasetDescriptor descriptor, Class<E> type); static D update(String uri, DatasetDescriptor descriptor); static boolean delete(URI uri); static boolean delete(String uri); static boolean moveToTrash(URI uri); static boolean moveToTrash(String uri); static boolean exists(URI uri); static boolean exists(String uri); static Collection<URI> list(URI uri); static Collection<URI> list(String uri); }
Datasets { public static Collection<URI> list(URI uri) { boolean isRepo = URIBuilder.REPO_SCHEME.equals(uri.getScheme()); Preconditions.checkArgument(isRepo, "Not a repository URI: " + uri); DatasetRepository repo = Registration .open(URI.create(uri.getRawSchemeSpecificPart())); URI repoUri = repo.getUri(); List<URI> datasets = Lists.newArrayList(); for (String namespace : repo.namespaces()) { for (String dataset : repo.datasets(namespace)) { datasets.add(new URIBuilder(repoUri, namespace, dataset).build()); } } return datasets; }  @SuppressWarnings("unchecked") static V load(URI uri, Class<E> type); @SuppressWarnings("unchecked") static V load(URI uri); static V load(String uriString, Class<E> type); static V load(String uriString); @SuppressWarnings("unchecked") static V create(URI uri, DatasetDescriptor descriptor, Class<E> type); @SuppressWarnings("unchecked") static V create(URI uri, DatasetDescriptor descriptor); static V create(String uri, DatasetDescriptor descriptor, Class<E> type); @SuppressWarnings("unchecked") static V create(String uri, DatasetDescriptor descriptor); @SuppressWarnings("unchecked") static D update(
      URI uri, DatasetDescriptor descriptor, Class<E> type); @SuppressWarnings("unchecked") static D update(
      URI uri, DatasetDescriptor descriptor); static D update(String uri, DatasetDescriptor descriptor, Class<E> type); static D update(String uri, DatasetDescriptor descriptor); static boolean delete(URI uri); static boolean delete(String uri); static boolean moveToTrash(URI uri); static boolean moveToTrash(String uri); static boolean exists(URI uri); static boolean exists(String uri); static Collection<URI> list(URI uri); static Collection<URI> list(String uri);  }