@Override
  public ImportResult importItem(
      UUID jobId,
      IdempotentImportExecutor idempotentImportExecutor,
      TokensAndUrlAuthData authData,
      PhotosContainerResource resource)
      throws Exception {
    KoofrClient koofrClient = koofrClientFactory.create(authData);
    monitor.debug(
        () ->
            String.format(
                "%s: Importing %s albums and %s photos before transmogrification",
                jobId, resource.getAlbums().size(), resource.getPhotos().size()));

    // Make the data Koofr compatible
    resource.transmogrify(transmogrificationConfig);
    monitor.debug(
        () ->
            String.format(
                "%s: Importing %s albums and %s photos after transmogrification",
                jobId, resource.getAlbums().size(), resource.getPhotos().size()));

    for (PhotoAlbum 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 (PhotoModel photoModel : resource.getPhotos()) {
      idempotentImportExecutor.importAndSwallowIOExceptions(
          photoModel,
          photo -> {
            ItemImportResult<String> fileImportResult =
                importSinglePhoto(photoModel, jobId, idempotentImportExecutor, koofrClient);
            if (fileImportResult != null && fileImportResult.hasBytes()) {
              totalImportedFilesSizes.add(fileImportResult.getBytes());
            }
            return fileImportResult;
          });
    }
    return ImportResult.OK.copyWithBytes(totalImportedFilesSizes.longValue());
  }
Imports albums and photos to Koofr.
extensions/data-transfer/portability-data-transfer-koofr/src/main/java/org/datatransferproject/transfer/koofr/photos/KoofrPhotosImporter.java