use of org.datatransferproject.datatransfer.flickr.photos.FlickrPhotosImporter in project data-transfer-project by google.
the class FlickrTransferExtension method initialize.
@Override
public void initialize(ExtensionContext context) {
if (initialized)
return;
jobStore = context.getService(TemporaryPerJobDataStore.class);
Monitor monitor = context.getMonitor();
try {
appCredentials = context.getService(AppCredentialStore.class).getAppCredentials(FLICKR_KEY, FLICKR_SECRET);
} catch (Exception e) {
monitor.info(() -> format("Unable to retrieve Flickr AppCredentials. Did you set %s and %s?", FLICKR_KEY, FLICKR_SECRET), e);
initialized = false;
return;
}
TransferServiceConfig serviceConfig = context.getService(TransferServiceConfig.class);
importer = new FlickrPhotosImporter(appCredentials, jobStore, monitor, serviceConfig);
exporter = new FlickrPhotosExporter(appCredentials, serviceConfig);
initialized = true;
}
Aggregations