public static List<Path> hadoopFsListChildren(String dirName, Configuration conf, String user)
    throws URISyntaxException, IOException, InterruptedException {

    Path p = hadoopFsPath(dirName, conf, user);
    FileSystem fs =  p.getFileSystem(conf);
    if(!fs.exists(p)) {
      return Collections.emptyList();
    }
    FileStatus[] children = fs.listStatus(p);
    if(!isset(children)) {
      return Collections.emptyList();
    }
    List<Path> files = new ArrayList<Path>();
    for(FileStatus stat : children) {
      files.add(stat.getPath());
    }
    return files;
  }
Returns all files (non-recursive) in {@code dirName}
hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/tool/TempletonUtils.java