Search in sources :

Example 6 with VideoAlbum

use of org.datatransferproject.types.common.models.videos.VideoAlbum 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);
    }
}
Also used : VideosContainerResource(org.datatransferproject.types.common.models.videos.VideosContainerResource) KoofrClient(org.datatransferproject.transfer.koofr.common.KoofrClient) IOException(java.io.IOException) VideoAlbum(org.datatransferproject.types.common.models.videos.VideoAlbum) VideoModel(org.datatransferproject.types.common.models.videos.VideoModel) KoofrMediaExport(org.datatransferproject.transfer.koofr.common.KoofrMediaExport) ExportResult(org.datatransferproject.spi.transfer.provider.ExportResult)

Aggregations

VideoAlbum (org.datatransferproject.types.common.models.videos.VideoAlbum)6 VideoModel (org.datatransferproject.types.common.models.videos.VideoModel)6 VideosContainerResource (org.datatransferproject.types.common.models.videos.VideosContainerResource)5 UUID (java.util.UUID)4 Test (org.junit.Test)4 MockResponse (okhttp3.mockwebserver.MockResponse)3 InOrder (org.mockito.InOrder)3 KoofrClient (org.datatransferproject.transfer.koofr.common.KoofrClient)2 IOException (java.io.IOException)1 ExportResult (org.datatransferproject.spi.transfer.provider.ExportResult)1 KoofrMediaExport (org.datatransferproject.transfer.koofr.common.KoofrMediaExport)1