public Map<String, Object> fileStatusToJSON(FileStatus status) {
    Map<String, Object> json = new LinkedHashMap<String, Object>();
    json.put("path", Path.getPathWithoutSchemeAndAuthority(status.getPath())
        .toString());
    json.put("isDirectory", status.isDirectory());
    json.put("len", status.getLen());
    json.put("owner", status.getOwner());
    json.put("group", status.getGroup());
    json.put("permission", permissionToString(status.getPermission()));
    json.put("accessTime", status.getAccessTime());
    json.put("modificationTime", status.getModificationTime());
    json.put("blockSize", status.getBlockSize());
    json.put("replication", status.getReplication());
    json.put("readAccess", checkAccessPermissions(status, FsAction.READ, ugi));
    json.put("writeAccess", checkAccessPermissions(status, FsAction.WRITE, ugi));
    json.put("executeAccess", checkAccessPermissions(status, FsAction.EXECUTE, ugi));
    json.put(KeyIsErasureCoded, status.isErasureCoded());
    json.put(KeyIsEncrypted, status.isEncrypted());

    if( status instanceof HdfsFileStatus){
      HdfsFileStatus hdfsFileStatus = (HdfsFileStatus) status;
      if(null != hdfsFileStatus.getErasureCodingPolicy()) {
        json.put(KeyErasureCodingPolicyName, hdfsFileStatus.getErasureCodingPolicy().getName());
      }
    }
    return json;
  }
Converts a Hadoop <code>FileStatus</code> object into a JSON array object.
It replaces the <code>SCHEME://HOST:PORT</code> of the path with the
specified URL.
<p/>

@param status Hadoop file status.
@return The JSON representation of the file status.
contrib/views/utils/src/main/java/org/apache/ambari/view/utils/hdfs/HdfsApi.java