Search in sources :

Example 1 with IStorage

use of org.eclipse.userstorage.IStorage in project epp.mpc by eclipse.

the class MarketplaceStorageService method createStorage.

protected IStorage createStorage() {
    IStorage storage = getStorageFactory().create(applicationToken, new FileStorageCache.SingleApplication(this.applicationToken));
    credentialsProvider = new EclipseOAuthCredentialsProvider(new MPCOAuthParameters());
    credentialsProvider.setInteractive(false);
    storage.setCredentialsProvider(credentialsProvider);
    return storage;
}
Also used : FileStorageCache(org.eclipse.userstorage.util.FileStorageCache) IStorage(org.eclipse.userstorage.IStorage) EclipseOAuthCredentialsProvider(org.eclipse.userstorage.oauth.EclipseOAuthCredentialsProvider)

Example 2 with IStorage

use of org.eclipse.userstorage.IStorage in project epp.mpc by eclipse.

the class MarketplaceDiscoveryStrategy method applyShellProvider.

protected void applyShellProvider() {
    IUserFavoritesService userFavoritesService = marketplaceService.getUserFavoritesService();
    if (userFavoritesService == null) {
        return;
    }
    IMarketplaceStorageService storageService = userFavoritesService.getStorageService();
    if (storageService == null) {
        return;
    }
    IStorage storage = storageService.getStorage();
    ICredentialsProvider credentialsProvider = storage.getCredentialsProvider();
    if (credentialsProvider instanceof EclipseOAuthCredentialsProvider) {
        ((EclipseOAuthCredentialsProvider) credentialsProvider).setShell(shellProvider);
    }
}
Also used : ICredentialsProvider(org.eclipse.userstorage.spi.ICredentialsProvider) IUserFavoritesService(org.eclipse.epp.mpc.core.service.IUserFavoritesService) IStorage(org.eclipse.userstorage.IStorage) EclipseOAuthCredentialsProvider(org.eclipse.userstorage.oauth.EclipseOAuthCredentialsProvider) IMarketplaceStorageService(org.eclipse.epp.mpc.core.service.IMarketplaceStorageService)

Aggregations

IStorage (org.eclipse.userstorage.IStorage)2 EclipseOAuthCredentialsProvider (org.eclipse.userstorage.oauth.EclipseOAuthCredentialsProvider)2 IMarketplaceStorageService (org.eclipse.epp.mpc.core.service.IMarketplaceStorageService)1 IUserFavoritesService (org.eclipse.epp.mpc.core.service.IUserFavoritesService)1 ICredentialsProvider (org.eclipse.userstorage.spi.ICredentialsProvider)1 FileStorageCache (org.eclipse.userstorage.util.FileStorageCache)1