use of org.datatransferproject.transfer.koofr.common.KoofrMediaExport in project data-transfer-project by google.
the class KoofrPhotosExporter method export.
@Override
public ExportResult<PhotosContainerResource> export(UUID jobId, TokensAndUrlAuthData authData, Optional<ExportInformation> exportInformation) throws CopyExceptionWithFailureReason {
Preconditions.checkNotNull(authData);
KoofrClient koofrClient = koofrClientFactory.create(authData);
KoofrMediaExport export = new KoofrMediaExport(koofrClient, monitor);
try {
export.export();
List<PhotoAlbum> exportAlbums = export.getPhotoAlbums();
List<PhotoModel> exportPhotos = export.getPhotos();
PhotosContainerResource containerResource = new PhotosContainerResource(exportAlbums, exportPhotos);
return new ExportResult<>(ExportResult.ResultType.END, containerResource, null);
} catch (IOException e) {
return new ExportResult<>(e);
}
}
use of org.datatransferproject.transfer.koofr.common.KoofrMediaExport in project data-transfer-project by google.
the class KoofrVideosExporter method export.
@Override
public ExportResult<VideosContainerResource> export(UUID jobId, TokensAndUrlAuthData authData, Optional<ExportInformation> exportInformation) throws CopyExceptionWithFailureReason {
Preconditions.checkNotNull(authData);
KoofrClient koofrClient = koofrClientFactory.create(authData);
KoofrMediaExport export = new KoofrMediaExport(koofrClient, monitor);
try {
export.export();
List<VideoAlbum> exportAlbums = export.getVideoAlbums();
List<VideoModel> exportVideos = export.getVideos();
VideosContainerResource containerResource = new VideosContainerResource(exportAlbums, exportVideos);
return new ExportResult<>(ExportResult.ResultType.END, containerResource, null);
} catch (IOException e) {
return new ExportResult<>(e);
}
}
Aggregations