@Override
  public ImportResult importItem(
      UUID jobId,
      IdempotentImportExecutor idempotentImportExecutor,
      TokensAndUrlAuthData authData,
      VideosContainerResource resource)
      throws Exception {
    KoofrClient koofrClient = koofrClientFactory.create(authData);

    monitor.debug(
        () ->
            String.format(
                "%s: Importing %s albums and %s videos",
                jobId, resource.getAlbums().size(), resource.getVideos().size()));

    // TODO: VideosContainerResource does not support transmogrification

    for (VideoAlbum album : resource.getAlbums()) {
      // Create a Koofr folder and then save the id with the mapping data
      idempotentImportExecutor.executeAndSwallowIOExceptions(
          album.getId(), album.getName(), () -> createAlbumFolder(album, koofrClient));
    }

    final LongAdder totalImportedFilesSizes = new LongAdder();
    for (VideoModel videoModel : resource.getVideos()) {
      idempotentImportExecutor.importAndSwallowIOExceptions(
          videoModel,
          video -> {
            ItemImportResult<String> fileImportResult =
                importSingleVideo(videoModel, jobId, idempotentImportExecutor, koofrClient);
            if (fileImportResult != null && fileImportResult.hasBytes()) {
              totalImportedFilesSizes.add(fileImportResult.getBytes());
            }
            return fileImportResult;
          });
    }
    return ImportResult.OK.copyWithBytes(totalImportedFilesSizes.longValue());
  }
Imports videos and their albums to Koofr.
extensions/data-transfer/portability-data-transfer-koofr/src/main/java/org/datatransferproject/transfer/koofr/videos/KoofrVideosImporter.java