IPath remotePathObj = resource.getLocation();
int count = remotePathObj.matchingFirstSegments(_runtime.getDesignRoot().getLocation());
remotePathObj = remotePathObj.removeFirstSegments(count);
String remotePath = remotePathObj.toString();
if (resource.getType() == IResource.FILE) {
DataSource content = new FileDataSource(((IFile) resource).getLocation().toFile());
try {
_remoteServer.getServices().updateFSDesignResource(_remoteServer.getSession(), remotePath, content, resource.getLocalTimeStamp());
}
catch (WGAServiceException e) {
throw new CoreException(new Status(IStatus.ERROR, WGADesignerPlugin.PLUGIN_ID, "Creating design file failed.", e));