code: private Collection<FileStatus> toFileStatusesWithImplicitDirectories(
        Collection<FileInfo> fileInfos) throws IOException {
      List<FileStatus> fileStatuses = new ArrayList<>(fileInfos.size());
      Set<URI> filePaths = Sets.newHashSetWithExpectedSize(fileInfos.size());
      String userName = getUgiUserName();
      for (FileInfo fileInfo : fileInfos) {
        filePaths.add(fileInfo.getPath());
        fileStatuses.add(getFileStatus(fileInfo, userName));
      }
  
      // The flow for populating this doesn't bother to populate metadata entries for parent
      // directories but we know the parent directories are expected to exist, so we'll just
      // populate the missing entries explicitly here. Necessary for getFileStatus(parentOfInfo)
      // to work when using an instance of this class.
      for (FileInfo fileInfo : fileInfos) {
        URI parentPath = getGcsFs().getParentPath(fileInfo.getPath());
        while (parentPath != null && !parentPath.equals(GoogleCloudStorageFileSystem.GCS_ROOT)) {
          if (!filePaths.contains(parentPath)) {
            logger.atFine().log("Adding fake entry for missing parent path '%s'", parentPath);
            StorageResourceId id = pathCodec.validatePathAndGetId(parentPath, true);
  
            GoogleCloudStorageItemInfo fakeItemInfo =
                GoogleCloudStorageItemInfo.createInferredDirectory(id);
            FileInfo fakeFileInfo = FileInfo.fromItemInfo(pathCodec, fakeItemInfo);
  
            filePaths.add(parentPath);
            fileStatuses.add(getFileStatus(fakeFileInfo, userName));
          }
          parentPath = getGcsFs().getParentPath(parentPath);
        }
      }
  
      return fileStatuses;
    }
docs: Helper method that converts {@link FileInfo} collection to {@link FileStatus} collection.