code: @Override
    public String[] listSnapshots() throws IOException {
      Path ssPath = new Path(ssDir);
  
      if (!dfs.exists(ssPath)) {
        throw new FileNotFoundException("Snapshot dir doesn't exist");
      }
  
      FileStatus ssStatus = dfs.getFileStatus(ssPath);
        if (!ssStatus.isDir()) {
          throw new IOException("ssDir " + ssDir  +" is not a directory");
        }
  
      FileStatus[] files = dfs.listStatus(ssPath);
      List<String> ssIds = new ArrayList<String>();
  
      // Separate snapshot files
      for (FileStatus ss: files) {
        if (ss.isDir()) continue; // skips dirs
        String name = ss.getPath().getName();
        if (!name.startsWith("dfs_snapshot_")) continue;
        ssIds.add(name.substring(13));
      }
  
      String[] rtn = new String[ssIds.size()];
      for (int i = 0; i < ssIds.size(); i++) {
        rtn[i] = ssIds.get(i);
      }
  
      return rtn;
    }
docs: SNAPSHOT PROTOCOL //