static void cleanupEmptyDir(HiveConf conf, Path path) throws IOException {
      FileSystem fs = path.getFileSystem(conf);
      try {
        if (!fs.listFiles(path, false).hasNext()) {
          fs.delete(path, true);
        }
      } catch (FileNotFoundException e) {
        // Ignore the case when the dir was already removed
        LOG.warn("Ignored exception during cleanup {}", path, e);
      }
    }
Remove the directory if it's empty.
@param conf the Hive configuration
@param path path of the directory
@throws IOException if any IO error occurs
ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/QueryCompactor.java