public BundleInfo[] save(Manipulator manipulator, boolean backup) throws IOException {
    List setToInitialConfig = new LinkedList();
    List setToSimpleConfig = new LinkedList();
    ConfigData configData = manipulator.getConfigData();

    if (!divideBundleInfos(
        manipulator,
        setToInitialConfig,
        setToSimpleConfig,
        configData.getInitialBundleStartLevel())) return configData.getBundles();

    File outputFile = getConfigFile(manipulator);
    URI installArea =
        ParserUtils.getOSGiInstallArea(
                Arrays.asList(manipulator.getLauncherData().getProgramArgs()),
                manipulator.getConfigData().getProperties(),
                manipulator.getLauncherData())
            .toURI();
    saveConfiguration(
        (BundleInfo[]) setToSimpleConfig.toArray(new BundleInfo[setToSimpleConfig.size()]),
        outputFile,
        installArea,
        backup);
    configData.setProperty(
        SimpleConfiguratorManipulatorImpl.PROP_KEY_CONFIGURL, outputFile.toURL().toExternalForm());
    return orderingInitialConfig(setToInitialConfig);
  }