-
- // private class FetchJob extends Job {
- // private RepoSync repoSync;
- // private final Authentication authentication;
- // private Subject subject;
- //
- // public FetchJob(RepoSync repoSync) {
- // super("Fetch");
- // this.repoSync = repoSync;
- // authentication = SecurityContextHolder.getContext()
- // .getAuthentication();
- // subject = Subject.getSubject(AccessController.getContext());
- // }
- //
- // @Override
- // protected IStatus run(final IProgressMonitor progressMonitor) {
- // PrivilegedAction<IStatus> privilegedAction = new
- // PrivilegedAction<IStatus>() {
- // public IStatus run() {
- // try {
- // // SecurityContextHolder.setContext(securityContext);
- // SecurityContextHolder.getContext().setAuthentication(
- // authentication);
- // ArgeoMonitor monitor = new EclipseArgeoMonitor(
- // progressMonitor);
- // repoSync.setMonitor(monitor);
- // repoSync.run();
- // } catch (Exception e) {
- // return new Status(IStatus.ERROR, DistPlugin.ID,
- // "Cannot fetch repository", e);
- // }
- // return Status.OK_STATUS;
- // }
- //
- // };
- // return Subject.doAs(subject, privilegedAction);
- // }
- // }