public WGARuntimeConfiguration getConfiguration() {
return _config;
}
public void flushConfig() throws CoreException {
FileOutputStream configFileStream = null;
try {
IFile configFile = getConfigFile();
if (configFile.isReadOnly()) {
ResourceAttributes attributes = configFile.getResourceAttributes(); // ResourceAttributes.fromFile(configFile.getLocation().toFile());
attributes.setReadOnly(false);
configFile.setResourceAttributes(attributes);
}
// we might have to update root url bc. of distribution changes
if (getRootURL() != null) {
WGAConfiguration wgaConfig = retrieveWGAConfig(false);
if (wgaConfig != null) {
wgaConfig.getServerOptions().put(WGAConfiguration.SERVEROPTION_ROOT_URL, getRootURL().toString());
saveWGAConfig(wgaConfig);
}
}
configFileStream = new FileOutputStream(configFile.getLocation().toFile());
WGARuntimeConfiguration.write(_config, configFileStream);
_project.refreshLocal(IResource.DEPTH_ONE, null);
} catch (Exception e) {
WGADesignerPlugin.getDefault().logError("Unable to save config of runtime '" + getName() + "'.", e);
throw new CoreException(new Status(Status.ERROR, WGADesignerPlugin.PLUGIN_ID, "Unable to save config of runtime '" + getName() + "'.", e));
} finally {
try {
if (configFileStream != null) {
configFileStream.close();
}
} catch (IOException e) {
}
}