code: public void cleanupAllVolumes() throws IOException {
      for (int v = 0; v < volumes.length; v++) {
        // List all files inside the volumes
        FileStatus[] files = localFileSystem.listStatus(new Path(volumes[v]));
        if (files != null) {
          // We tolerate missing volumes.
          for (int f = 0; f < files.length; f++) {
            // Get the file name - the last component of the Path
            String entryName = files[f].getPath().getName();
            // Do not delete the current TOBEDELETED
            if (!TOBEDELETED.equals(entryName)) {
              moveAndDeleteRelativePath(volumes[v], entryName);
            }
          }
        }
      }
    }
docs: Move all files/directories inside volume into TOBEDELETED, and then
  delete them.  The TOBEDELETED directory itself is ignored.