public static boolean pathExists(Path p, Configuration conf) throws HiveException {
    try {
      FileSystem fs = p.getFileSystem(conf);
      return fs.exists(p);
    } catch (IOException e) {
      throw new HiveException(e);
    }
  }
List filestatuses in the given directory.
In recursive mode all files are returned, otherwise directories are skipped.
@param fs FileSystem
@param path directory to list
@param filter optional filter
@param recursive do recursive listing
@return
@throws IOException
ql/src/java/org/apache/hadoop/hive/ql/io/HdfsUtils.java