@SuppressWarnings("deprecation") @Override public Set<String> namespaces() { Set<String> namespaces = Sets.newHashSet(); try { FileStatus[] entries = rootFileSystem.listStatus(rootDirectory, PathFilters.notHidden()); for (FileStatus entry : entries) { if (entry.isDir()) { // may want to add a check: !RESERVED_NAMES.contains(name) if (isNamespace(entry.getPath())) { namespaces.add(entry.getPath().getName()); } else if (isDataset(entry.getPath())) { // add the default namespace for datasets with no namespace namespaces.add(DEFAULT_NAMESPACE); } } } } catch (FileNotFoundException ex) { // the repo hasn't created any files yet return namespaces; } catch (IOException ex) { throw new DatasetIOException("Could not list namespaces", ex); } return namespaces; }