else throw new IllegalStateException(NLS.bind(Messages.exception_unexpectedfwConfigLocation, fwConfigLocation.getAbsolutePath(), EquinoxConstants.CONFIG_INI)); launcherData.setFwConfigLocation(fwConfigLocation); } else { if (fwPersistentDataLocation != null) { launcherData.setFwConfigLocation(fwPersistentDataLocation); } else { File home = launcherData.getHome(); fwConfigLocation = new File(home, "configuration"); //$NON-NLS-1$ launcherData.setFwPersistentDataLocation(fwConfigLocation, launcherData.isClean()); launcherData.setFwConfigLocation(fwConfigLocation);
else throw new IllegalStateException(NLS.bind(Messages.exception_unexpectedfwConfigLocation, fwConfigLocation.getAbsolutePath(), EquinoxConstants.CONFIG_INI)); launcherData.setFwConfigLocation(fwConfigLocation); } else { if (fwPersistentDataLocation != null) { launcherData.setFwConfigLocation(fwPersistentDataLocation); } else { File home = launcherData.getHome(); fwConfigLocation = new File(home, "configuration"); //$NON-NLS-1$ launcherData.setFwPersistentDataLocation(fwConfigLocation, launcherData.isClean()); launcherData.setFwConfigLocation(fwConfigLocation);
private URI getConfigurationLocation(List lines, URI osgiInstallArea, LauncherData data) { String configuration = ParserUtils.getValueForArgument(EquinoxConstants.OPTION_CONFIGURATION, lines); if (configuration == null) try { return URIUtil.makeAbsolute(new URI(CONFIGURATION_FOLDER), osgiInstallArea); } catch (URISyntaxException e1) { //ignore } URI result = null; try { result = URIUtil.makeAbsolute(FileUtils.fromPath(configuration), osgiInstallArea); ParserUtils.setValueForArgument(EquinoxConstants.OPTION_CONFIGURATION, result.toString(), lines); data.setFwConfigLocation(URIUtil.toFile(result)); } catch (URISyntaxException e) { Log.log(LogService.LOG_ERROR, NLS.bind(Messages.log_failed_make_absolute, configuration)); return null; } return result; }
private URI getConfigurationLocation(List<String> lines, URI osgiInstallArea, LauncherData data) { String configuration = ParserUtils.getValueForArgument(EquinoxConstants.OPTION_CONFIGURATION, lines); if (configuration == null) try { return URIUtil.makeAbsolute(new URI(CONFIGURATION_FOLDER), osgiInstallArea); } catch (URISyntaxException e1) { //ignore } URI result = null; try { result = URIUtil.makeAbsolute(FileUtils.fromPath(configuration), osgiInstallArea); ParserUtils.setValueForArgument(EquinoxConstants.OPTION_CONFIGURATION, result.toString(), lines); data.setFwConfigLocation(URIUtil.toFile(result)); } catch (URISyntaxException e) { Log.log(LogService.LOG_ERROR, NLS.bind(Messages.log_failed_make_absolute, configuration)); return null; } return result; }
private boolean initializeFromConfigFiles() { FrameworkAdmin fwk = LazyManipulator.getFrameworkAdmin(); if (fwk == null) return false; Manipulator manipulator = fwk.getManipulator(); LauncherData launcherData = manipulator.getLauncherData(); launcherData.setFwConfigLocation(configurationFolder != null ? configurationFolder : new File(installFolder, "configuration/config.ini")); //$NON-NLS-1$ launcherData.setHome(installFolder); try { manipulator.load(); } catch (IllegalStateException e) { return false; } catch (FrameworkAdminRuntimeException e) { return false; } catch (IOException e) { return false; } profileId = manipulator.getConfigData().getProperty("eclipse.p2.profile"); //$NON-NLS-1$ p2DataAreaURI = manipulator.getConfigData().getProperty("eclipse.p2.data.area"); //$NON-NLS-1$ return true; }
private boolean initializeFromConfigFiles() { FrameworkAdmin fwk = LazyManipulator.getFrameworkAdmin(); if (fwk == null) return false; Manipulator manipulator = fwk.getManipulator(); LauncherData launcherData = manipulator.getLauncherData(); launcherData.setFwConfigLocation(configurationFolder != null ? configurationFolder : new File(installFolder, "configuration/config.ini")); //$NON-NLS-1$ launcherData.setHome(installFolder); try { manipulator.load(); } catch (IllegalStateException e) { return false; } catch (FrameworkAdminRuntimeException e) { return false; } catch (IOException e) { return false; } profileId = manipulator.getConfigData().getProperty("eclipse.p2.profile"); //$NON-NLS-1$ p2DataAreaURI = manipulator.getConfigData().getProperty("eclipse.p2.data.area"); //$NON-NLS-1$ return true; }
private void loadDelegate() { if (manipulator != null) return; manipulator = getFrameworkManipulator(); if (manipulator == null) throw new IllegalStateException(Messages.failed_acquire_framework_manipulator); LauncherData launcherData = manipulator.getLauncherData(); launcherData.setFwConfigLocation(Util.getConfigurationFolder(profile)); launcherData.setLauncher(Util.getLauncherPath(profile)); launcherData.setLauncherConfigLocation(Util.getLauncherConfigLocation(profile)); launcherData.setOS(Util.getOSFromProfile(profile)); launcherData.setHome(Util.getInstallFolder(profile)); try { manipulator.load(); } catch (IllegalStateException e) { //if fwJar is not included, this exception will be thrown. But ignore it. LogHelper.log(Util.createError(Messages.error_loading_manipulator, e)); throw new IllegalStateException(Messages.error_loading_manipulator); } catch (FrameworkAdminRuntimeException e) { LogHelper.log(Util.createError(Messages.error_loading_manipulator, e)); } catch (IOException e) { LogHelper.log(Util.createError(Messages.error_loading_manipulator, e)); throw new IllegalStateException(Messages.error_loading_manipulator); } //TODO These values should be inserted by a configuration unit (bug 204124) manipulator.getConfigData().setProperty("eclipse.p2.profile", profile.getProfileId()); //$NON-NLS-1$ manipulator.getConfigData().setProperty("eclipse.p2.data.area", Util.getAgentLocation(agent).getRootLocation().toString()); //$NON-NLS-1$ }
private void loadDelegate() { if (manipulator != null) return; manipulator = getFrameworkManipulator(); if (manipulator == null) throw new IllegalStateException(Messages.failed_acquire_framework_manipulator); LauncherData launcherData = manipulator.getLauncherData(); launcherData.setFwConfigLocation(Util.getConfigurationFolder(profile)); launcherData.setLauncher(Util.getLauncherPath(profile)); launcherData.setLauncherConfigLocation(Util.getLauncherConfigLocation(profile)); launcherData.setOS(Util.isMacOSBundled(profile) ? org.eclipse.equinox.p2.core.spi.Constants.MACOSX_BUNDLED : Util.getOSFromProfile(profile)); launcherData.setHome(Util.getInstallFolder(profile)); try { manipulator.load(); } catch (IllegalStateException e) { //if fwJar is not included, this exception will be thrown. But ignore it. LogHelper.log(Util.createError(Messages.error_loading_manipulator, e)); throw new IllegalStateException(Messages.error_loading_manipulator); } catch (FrameworkAdminRuntimeException e) { LogHelper.log(Util.createError(Messages.error_loading_manipulator, e)); } catch (IOException e) { LogHelper.log(Util.createError(Messages.error_loading_manipulator, e)); throw new IllegalStateException(Messages.error_loading_manipulator); } //TODO These values should be inserted by a configuration unit (bug 204124) manipulator.getConfigData().setProperty("eclipse.p2.profile", profile.getProfileId()); //$NON-NLS-1$ manipulator.getConfigData().setProperty("eclipse.p2.data.area", Util.getAgentLocation(agent).getRootLocation().toString()); //$NON-NLS-1$ }