try {
getContainer().run(true, false, new IRunnableWithProgress() {
@Override
public void run(final IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
final ResourceChangeCommandFactory factory = new ResourceChangeCommandFactory(Activator
.getDefault().getSerializationManager());
final Repository[] selectedServer = new Repository[1];
Display.getDefault().syncExec(new Runnable() {
@Override
public void run() {
try {
selectedServer[0] = ServerUtil.getConnectedRepository(exportPage.getServer(), monitor);
} catch (CoreException e) {
throw new RuntimeException(e);
}
}
});
try {
syncStartPoint.accept(new IResourceVisitor() {
@Override
public boolean visit(IResource resource) throws CoreException {
Command<?> command = factory.newCommandForAddedOrUpdated(selectedServer[0], resource);
if (command == null) {
return true;
}
Result<?> result = command.execute();
if (!result.isSuccess()) {