code: private Path[] listPaths(final Path path)
        throws IOException {
      Path[] children = null;
      ArrayList<Path> tmpChildrenPath = new ArrayList<>();
      if (fs.isDirectory(path)) {
        // Get children's path list.
        FileStatus[] chiledrenFileStatus = pathFilter == null ? fs.listStatus(path) : fs.listStatus(path, pathFilter);
        for (FileStatus childFileStatus : chiledrenFileStatus) {
          tmpChildrenPath.add(childFileStatus.getPath());
        }
        children = tmpChildrenPath.toArray(new Path[tmpChildrenPath.size()]);
      }
      if (children == null) {
        children = EMPTY_PATH_ARRAY;
      }
      if (comparator != null && children.length > 1) {
        Arrays.sort(children, comparator);
      }
      return children;
    }
docs: List the contents of a directory denoted by Path
  
  @param path The path(File Object in general file system) to list the contents of
  @return the directory contents or a zero length array if
  the empty or the file is not a directory