class FileBasedStorage implements StorageProvider {

  @Override
  public @Nonnull Set<String> listResolvableNames(Class<? extends Id> type, Id... ancestors)
      throws IOException {
    Path idsDir = getIdsDir(type, ancestors);
    if (!Files.exists(idsDir)) {
      return ImmutableSet.of();
    }
    try (Stream<Path> files = list(idsDir)) {
      return files
          .filter(
              path -> {
                try {
                  return fromBase64(path.getFileName().toString()).endsWith(ID_EXTENSION);
                } catch (IllegalArgumentException e) {
                  return false;
                }
              })
          .map(Path::getFileName)
          .map(Path::toString)
          .map(FileBasedStorage::fromBase64)
          .map(
              nameWithExtension ->
                  nameWithExtension.substring(
                      0, nameWithExtension.length() - ID_EXTENSION.length()))
          .collect(ImmutableSet.toImmutableSet());
    } catch (IOException e) {
      throw new IOException("Could not list files in '" + idsDir + "'", e);
    }
  }

  public  FileBasedStorage(
      Path baseDir, BatfishLogger logger, BiFunction<String, Integer, AtomicInteger> newBatch);
  public  FileBasedStorage(Path baseDir, BatfishLogger logger);

}