wgaSyncInfo.getServer().connectToServer();
session = wgaSyncInfo.getServer().getSession();
}
int change = SyncInfo.getChange(wgaSyncInfo.getKind());
IResource resource = wgaSyncInfo.getLocal();
String remotePath = wgaSyncInfo.getRemotePath();
if (remotePath != null) {
if (change == SyncInfo.DELETION) {
monitor.setTaskName("deleting '" + remotePath + "'.");
wgaSyncInfo.getServer().getServices().deleteFSDesignResource(session, remotePath);
committedResources.add(resource);
} else if ((change == SyncInfo.ADDITION || change == SyncInfo.CHANGE)) {
if (change == SyncInfo.ADDITION) {
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);
}
}
}