class FileBasedStorage implements StorageProvider {

  @Override
  public void runGarbageCollection(Instant expungeBeforeDate) throws IOException {
    // Go back GC_SKEW_ALLOWANCE_MINUTES minutes to account for skew. This should safely
    // underapproximate data to delete.
    Instant safeExpungeBeforeDate = expungeBeforeDate.minus(GC_SKEW_ALLOWANCE);
    _logger.debugf("FBS GC: Expunge before: %s\n", safeExpungeBeforeDate);

    // Iterate over network dirs directly so we can expunge data from both extant and deleted
    // networks.
    if (exists(getNetworksDir())) {
      try (Stream<Path> networkDirStream = list(getNetworksDir())) {
        networkDirStream
            .map(networkDir -> new NetworkId(networkDir.getFileName().toString()))
            .forEach(
                networkId -> {
                  try {
                    expungeOldNetworkData(safeExpungeBeforeDate, networkId);
                  } catch (IOException e) {
                    _logger.errorf(
                        "Failed to expunge old data for network with ID '%s': %s",
                        networkId, Throwables.getStackTraceAsString(e));
                  }
                });
      }
    }
    // expunge answers
    expungeOldEntries(safeExpungeBeforeDate, getAnswersDir(), true);
  }

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

}