private void dropPathAndUnregisterDeleteOnExit(Path path, Configuration conf, boolean localFs) {
    FileSystem fs = null;
    try {
      if (localFs) {
        fs = FileSystem.getLocal(conf);
      } else {
        fs = path.getFileSystem(conf);
      }
      cleanupService.deleteRecursive(path, fs);
    } catch (IllegalArgumentException | UnsupportedOperationException | IOException e) {
      LOG.error("Failed to delete path at {} on fs with scheme {}", path,
          (fs == null ? "Unknown-null" : fs.getScheme()), e);
    }
  }
Create a given path if it doesn't exist.

@param conf
@param path
@param permission
@param isLocal
@param isCleanUp
@return
@throws IOException
ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java