private static void logFSTree(Logger log, final FileSystem fs, final Path root, String prefix)
    throws IOException {
    FileStatus[] files = listStatus(fs, root, null);
    if (files == null) {
      return;
    }

    for (FileStatus file : files) {
      if (file.isDirectory()) {
        log.debug(prefix + file.getPath().getName() + "/");
        logFSTree(log, fs, file.getPath(), prefix + "---");
      } else {
        log.debug(prefix + file.getPath().getName());
      }
    }
  }
Recursive helper to log the state of the FS
@see #logFileSystemState(FileSystem, Path, Logger)
hbase-common/src/main/java/org/apache/hadoop/hbase/util/CommonFSUtils.java