code: HdfsFileStatus[] getHdfsListing(String src) {
      
      // prepare components outside of readLock
      String srcs = normalizePath(src);
      byte[][] components = INodeDirectory.getPathComponents(srcs);
  
      readLock();
      try {
        INode targetNode = rootDir.getNode(components);
        if (targetNode == null)
          return null;
        if (!targetNode.isDirectory()) {
          return new HdfsFileStatus[]{createHdfsFileStatus(
          		HdfsFileStatus.EMPTY_NAME, targetNode)};
        }
        List<INode> contents = ((INodeDirectory)targetNode).getChildren();
        HdfsFileStatus listing[] = new HdfsFileStatus[contents.size()];
        int i = 0;
        for (INode cur : contents) {
          listing[i] = createHdfsFileStatus(cur.name, cur);
          i++;
        }
        return listing;
      } finally {
        readUnlock();
      }
    }
docs: Get a listing of files given path 'src'
  
  This function is admittedly very inefficient right now.  We'll
  make it better later.