public static void createPlatformConfiguration(File configLocation, IPluginModelBase[] models, IPluginModelBase brandingPlugin) throws CoreException { try { IPlatformConfiguration platformConfiguration = ConfiguratorUtils.getPlatformConfiguration(null); // Compute local sites ArrayList<LocalSite> sites = new ArrayList<>(); for (int i = 0; i < models.length; i++) { IPath path = new Path(models[i].getInstallLocation()).removeLastSegments(2); addToSite(path, models[i], sites); } createConfigurationEntries(platformConfiguration, sites); if (brandingPlugin != null) createFeatureEntries(platformConfiguration, brandingPlugin); platformConfiguration.refresh(); platformConfiguration.save(new URL("file:" + configLocation.getPath())); //$NON-NLS-1$ } catch (Exception e) { // Wrap everything else in a core exception. String message = e.getMessage(); if (message == null || message.length() == 0) message = PDECoreMessages.TargetPlatform_exceptionThrown; throw new CoreException(new Status(IStatus.ERROR, PDECore.PLUGIN_ID, IStatus.ERROR, message, e)); } }
platformConfiguration.save(new URL("file:" + configLocation.getPath())); //$NON-NLS-1$ } catch (Exception e) {