monitor.setTaskName("adding '" + remotePath + "'.");
} else {
monitor.setTaskName("updating '" + remotePath + "'.");
}
if (resource.getType() == IResource.FILE) {
DataSource content = new FileDataSource(((IFile)resource).getLocation().toFile());
wgaSyncInfo.getServer().getServices().updateFSDesignResource(session, remotePath, content, resource.getLocalTimeStamp());
committedResources.add(resource);
} else if (resource.getType() == IResource.FOLDER) {
wgaSyncInfo.getServer().getServices().mkFSDesignDir(session, remotePath);
committedResources.add(resource);
}
}
}
} catch (Exception e) {
throw new InvocationTargetException(e);
}
} else if (info instanceof WGAPluginResourceSyncInfo) {
try {
WGAPluginResourceSyncInfo wgaSyncInfo = (WGAPluginResourceSyncInfo) info;
if ((wgaSyncInfo.getKind() & SyncInfo.CONFLICTING) != SyncInfo.CONFLICTING) {
int change = SyncInfo.getChange(wgaSyncInfo.getKind());
if (change == SyncInfo.DELETION) {
WGARemoteServer remote = wgaSyncInfo.getServer();
remote.getServices().deactivatePlugin(remote.getSession(), ((WGAPluginResourceVariant)wgaSyncInfo.getRemote()).getPluginInfo());
committedResources.add(wgaSyncInfo.getLocal());
} else if (change == SyncInfo.ADDITION) {
WGARemoteServer local = wgaSyncInfo.getRuntime().createRemoteServer();
local.connectToServer();
DataSource plugin = local.getServices().downloadPlugin(local.getSession(), wgaSyncInfo.getLocalPluginInfo());
WGARemoteServer remote = wgaSyncInfo.getServer();
remote.getServices().installPlugins(remote.getSession(), Collections.singletonList(plugin));
remote.getServices().activatePlugin(remote.getSession(), wgaSyncInfo.getLocalPluginInfo());
committedResources.add(wgaSyncInfo.getLocal());
}