use of org.eclipse.userstorage.util.NotFoundException in project epp.mpc by eclipse.
the class UserFavoritesService method getFavoriteIds.
public Set<String> getFavoriteIds(IProgressMonitor monitor) throws NoServiceException, NotAuthorizedException, IllegalStateException, IOException {
SubMonitor progress = SubMonitor.convert(monitor, Messages.DefaultMarketplaceService_FavoritesRetrieve, 1000);
try {
String favoritesData = getFavoritesBlob().getContentsUTF();
// FIXME waiting for USS bug 488335 to have proper progress and cancelation
progress.worked(950);
Set<String> result = parseFavoritesBlobData(favoritesData);
synchronized (this) {
favorites.clear();
favorites.addAll(result);
}
return result;
} catch (NotFoundException ex) {
// the user does not yet have favorites
return new LinkedHashSet<String>();
} catch (OperationCanceledException ex) {
throw processProtocolException(ex);
} catch (ProtocolException ex) {
throw processProtocolException(ex);
}
}
Aggregations