@Override
  protected ObjectStatus getObjectStatus(String key) {
    try {
      ObjectMetadata meta = mClient.getObjectMetadata(mBucketName, key);
      if (meta == null) {
        return null;
      }
      if (isEnvironmentPFS()) {
        /**
         * When in PFS environment:
         * 1. Directory will be explicitly created and have object meta.
         * 2. File will have object meta even if there is `/` at
         *    the end of the file name (e.g. `/dir1/file1/`).
         * However we should return null meta here.
         */
        if (isDirectoryInPFS(meta)) {
          return null;
        }
        if (!isDirectoryInPFS(meta) && key.endsWith(PATH_SEPARATOR)) {
          return null;
        }
      }
      Date lastModifiedDate = meta.getLastModified();
      Long lastModifiedTime = lastModifiedDate == null ? null : lastModifiedDate.getTime();
      return new ObjectStatus(key, meta.getEtag(), meta.getContentLength(),
          lastModifiedTime);
    } catch (ObsException e) {
      LOG.warn("Failed to get Object {}, return null", key, e);
      return null;
    }
  }
@Test
  public void nullObjectMetaTest() throws Exception {
    ObjectMetadata fileMeta = new ObjectMetadata();
    fileMeta.setContentLength(10L);
    ObjectMetadata dirMeta = new ObjectMetadata();
    dirMeta.setContentLength(0L);
    /**
     * /xx/file1/ ( File1 actually exists, which is a file) , there is / after file1 name.
     * When OBS, the path object meta is null.
     * When PFS, the path object meta is not null. The object meta is same as /xx/file1
     */
    Mockito.when(mClient.getObjectMetadata(BUCKET_NAME, "pfs_file1"))
        .thenReturn(fileMeta);
    Mockito.when(mClient.getObjectMetadata(BUCKET_NAME, "dir1"))
        .thenReturn(dirMeta);

    mOBSUnderFileSystem = new OBSUnderFileSystem(new AlluxioURI(""), mClient, BUCKET_NAME, "obs",
        UnderFileSystemConfiguration.defaults(Configuration.global()));
    Assert.assertNotNull(mOBSUnderFileSystem.getObjectStatus("pfs_file1"));
    Assert.assertNotNull(mOBSUnderFileSystem.getObjectStatus("dir1"));
  }