private ItemImportResult<String> importSingleVideo(
      VideoModel video,
      UUID jobId,
      IdempotentImportExecutor idempotentImportExecutor,
      KoofrClient koofrClient)
      throws IOException, InvalidTokenException, DestinationMemoryFullException {
    monitor.debug(() -> String.format("Import single video %s", video.getName()));

    try {
      InputStreamWrapper inputStreamWrapper =
          connectionProvider.getInputStreamForItem(jobId, video);
      ItemImportResult<String> response;
      try (InputStream inputStream = inputStreamWrapper.getStream()) {
        String parentPath;
        if (video.getAlbumId() == null) {
          parentPath = koofrClient.ensureVideosFolder();
        } else {
          parentPath = idempotentImportExecutor.getCachedValue(video.getAlbumId());
        }

        String name = video.getName();
        String description = KoofrClient.trimDescription(video.getDescription());

        String fullPath = parentPath + "/" + name;

        if (koofrClient.fileExists(fullPath)) {
          monitor.debug(() -> String.format("Video already exists %s", video.getName()));

          return ItemImportResult.success(fullPath);
        }

        long inputStreamBytes = inputStreamWrapper.getBytes();
        String responseResult =
            koofrClient.uploadFile(
                parentPath,
                name,
                inputStream,
                video.getEncodingFormat(),
                video.getUploadedTime(),
                description);
        if (responseResult != null && !responseResult.isEmpty()) {
          response = ItemImportResult.success(responseResult, inputStreamBytes);
        } else {
          response =
              ItemImportResult.success(
                  String.format(SKIPPED_FILE_RESULT_FORMAT, video.getDataId()));
        }
      }
      return response;
    } catch (FileNotFoundException e) {
      monitor.info(
          () -> String.format("Video resource was missing for id: %s", video.getDataId()), e);
      return ItemImportResult.success(String.format(SKIPPED_FILE_RESULT_FORMAT, video.getDataId()));
    }
  }
Imports videos and their albums to Koofr.
extensions/data-transfer/portability-data-transfer-koofr/src/main/java/org/datatransferproject/transfer/koofr/videos/KoofrVideosImporter.java