@Override
  public FileStatus[] listStatus(Path path) throws IOException {
    LOG.debug("listStatus({})", path);

    if (mStatistics != null) {
      mStatistics.incrementReadOps(1);
    }

    AlluxioURI uri = getAlluxioPath(path);
    List<URIStatus> statuses;
    try {
      ListStatusPOptions listStatusPOptions = ListStatusPOptions.getDefaultInstance().toBuilder()
          .setExcludeMountInfo(mExcludeMountInfoOnListStatus).build();
      statuses = mFileSystem.listStatus(uri, listStatusPOptions);
    } catch (FileDoesNotExistException e) {
      throw new FileNotFoundException(getAlluxioPath(path).toString());
    } catch (InvalidArgumentRuntimeException e) {
      throw new IllegalArgumentException(e);
    } catch (AlluxioRuntimeException e) {
      throw toHdfsIOException(e);
    } catch (AlluxioException e) {
      throw new IOException(e);
    }

    FileStatus[] ret = new FileStatus[statuses.size()];
    for (int k = 0; k < statuses.size(); k++) {
      URIStatus status = statuses.get(k);
      ret[k] = new AlluxioFileStatus(status, getFsPath(mAlluxioHeader, status));
    }
    return ret;
  }
@Test
  public void listStatus() throws Exception {
    FileInfo fileInfo1 = new FileInfo()
        .setLastModificationTimeMs(111L)
        .setLastAccessTimeMs(123L)
        .setFolder(false)
        .setOwner("user1")
        .setGroup("group1")
        .setMode(00755);
    FileInfo fileInfo2 = new FileInfo()
        .setLastModificationTimeMs(222L)
        .setLastAccessTimeMs(234L)
        .setFolder(true)
        .setOwner("user2")
        .setGroup("group2")
        .setMode(00644);

    Path path = new Path("/dir");
    alluxio.client.file.FileSystem alluxioFs =
        mock(alluxio.client.file.FileSystem.class);
    FileSystem alluxioHadoopFs = new FileSystem(alluxioFs);
    URI uri = URI.create(Constants.HEADER + "host:1");
    alluxioHadoopFs.initialize(uri, getConf());
    ListStatusPOptions listStatusPOptions = ListStatusPOptions.getDefaultInstance().toBuilder()
        .setExcludeMountInfo(alluxioHadoopFs.mAlluxioConf.getBoolean(
            PropertyKey.USER_HDFS_CLIENT_EXCLUDE_MOUNT_INFO_ON_LIST_STATUS)).build();
    when(alluxioFs.listStatus(new AlluxioURI(HadoopUtils.getPathWithoutScheme(path)),
        listStatusPOptions))
        .thenReturn(Lists.newArrayList(new URIStatus(fileInfo1), new URIStatus(fileInfo2)));

    FileStatus[] fileStatuses = alluxioHadoopFs.listStatus(path);
    assertFileInfoEqualsFileStatus(fileInfo1, fileStatuses[0]);
    assertFileInfoEqualsFileStatus(fileInfo2, fileStatuses[1]);
    alluxioHadoopFs.close();
  }