throwCoreException("Unable to add task", e);
}
}
private void saveTargetProject(String projectFileName, ModelingProject project, IProgressMonitor monitor) throws CoreException {
SavingService service = new SavingService();
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
InputStream inStream = null;
try {
service.setTarget(project);
service.setOutStream(outStream);
service.initialize();
service.invoke();
inStream = new ByteArrayInputStream(outStream.toByteArray());
((IFile)ResourcesPlugin.getWorkspace().getRoot().findMember(new Path(projectFileName))).setContents(inStream, true, false, monitor);
} catch (ServiceException e) {
throwCoreException("Unable to save modeling project.", e);