public static List<LocatedFileStatus> listLocatedStatus(final FileSystem fs, final Path dir)
    throws IOException {
    List<LocatedFileStatus> status = null;
    try {
      RemoteIterator<LocatedFileStatus> locatedFileStatusRemoteIterator = fs.listFiles(dir, false);
      while (locatedFileStatusRemoteIterator.hasNext()) {
        if (status == null) {
          status = Lists.newArrayList();
        }
        status.add(locatedFileStatusRemoteIterator.next());
      }
    } catch (FileNotFoundException fnfe) {
      // if directory doesn't exist, return null
      if (LOG.isTraceEnabled()) {
        LOG.trace("{} doesn't exist", dir);
      }
    }
    return status;
  }
Calls fs.listFiles() to get FileStatus and BlockLocations together for reducing rpc call
@param fs  file system
@param dir directory
@return LocatedFileStatus list
hbase-common/src/main/java/org/apache/hadoop/hbase/util/CommonFSUtils.java