use of com.centurylink.mdw.plugin.designer.model.WorkflowAsset in project mdw-designer by CenturyLinkCloud.
the class ProjectConfigurator method loadGroovyScriptLibraries.
public void loadGroovyScriptLibraries(IProgressMonitor monitor) {
// locally save all the groovy libraries
for (WorkflowAsset asset : project.getTopLevelWorkflowAssets()) {
if (asset instanceof Script && ((Script) asset).isGroovy()) {
if (!asset.isLoaded())
asset.load();
try {
IFolder folder = asset.getTempFolder();
if (!folder.exists())
PluginUtil.createFoldersAsNeeded(project.getSourceProject(), folder, monitor);
IFile tempFile = asset.getTempFile(folder);
if (tempFile.exists())
new TempFileRemover(folder, tempFile).remove(monitor);
tempFile.create(new ByteArrayInputStream(asset.getFileContent()), true, monitor);
PluginMessages.log("Created groovy lib file: " + tempFile.getFullPath().toString());
} catch (CoreException ex) {
PluginMessages.uiError(ex, "Load Groovy Libraries", project);
}
}
}
}
Aggregations