Package org.apache.felix.utils.properties

Examples of org.apache.felix.utils.properties.Properties.save()


                    if (addTransitiveFeatures) {
                        addMissingDependenciesToRepo();
                    }
                    FileOutputStream out = new FileOutputStream(featuresCfgFile);
                    try {
                        properties.save(out);
                    } finally {
                        out.close();
                    }
                }
            } else {
View Full Code Here


        managedEtcs.save();

        if (restart) {
            updateStatus("restarting", null);
            configProps.save();
            systemProps.save();
            System.setProperty("karaf.restart", "true");
            bundleContext.getBundle(0).stop();
            return false;
        }
View Full Code Here

                Properties systemProps = new Properties(propsPath.toFile());
                systemProps.put(SystemProperties.KARAF_NAME, containerName);
                //Also pass zookeeper information so that the container can auto-join after the restart.
                systemProps.put("zookeeper.url", zookeeperUrl);
                systemProps.put("zookeeper.password", encodedPassword);
                systemProps.save();

                if (!nonManaged) {
                    installBundles();
                }
                //Restart the container
View Full Code Here

            for (String key : propertiesToRemove) {
                properties.remove(key);
            }
            // save the cfg file
            storage.mkdirs();
            properties.save();
        }
    }

    /* (non-Javadoc)
     * @see org.apache.karaf.shell.config.impl.ConfigRepository#getConfigProperties(java.lang.String)
View Full Code Here

                        String featuresBoot = featuresProperties.getProperty(FEATURES_BOOT);
                        featuresBoot = featuresBoot != null && featuresBoot.length() > 0 ? featuresBoot + "," : "";
                        if (!featuresBoot.contains(feature.getName())) {
                            featuresBoot = featuresBoot + feature.getName();
                            featuresProperties.put(FEATURES_BOOT, featuresBoot);
                            featuresProperties.save(featuresCfgFile);
                        }
                    }
                    // add the feature in the system folder
                    resolveFeature(feature, features);
                } else if (installedFeatures != null && installedFeatures.contains(feature.getName())) {
View Full Code Here

            String featureRepos = featuresProperties.getProperty(FEATURES_REPOSITORIES);
            featureRepos = featureRepos != null && featureRepos.length() > 0 ? featureRepos + "," : "";
            if (!featureRepos.contains(repository)) {
                featureRepos = featureRepos + repository;
                featuresProperties.put(FEATURES_REPOSITORIES, featureRepos);
                featuresProperties.save(featuresCfgFile);
            }
        }
        // resolving repository location
        File repositoryFile;
        if (repository.startsWith("mvn")) {
View Full Code Here

        if (shutdownCommand == null || shutdownCommand.isEmpty()) {
            shutdownCommand = UUID.randomUUID().toString();
            Properties temp = new Properties(file);
            temp.put(KARAF_SHUTDOWN_COMMAND, Arrays.asList("", "#", "# Generated command shutdown", "#"), shutdownCommand);
            temp.save();
        }
    }
   
    private String getPropertyOrFail(String propertyName) {
        String value = props.getProperty(propertyName);
View Full Code Here

            return;
        }
        try {
            Properties properties = loadProps();
            properties.put("karaf.framework", framework.name());
            properties.save();
        } catch (IOException e) {
            throw new RuntimeException("Error setting framework: " + e.getMessage(), e);
        }
    }
View Full Code Here

            } else {
                properties.remove("felix.log.level");
                properties.remove("osgi.debug");
            }
            // TODO populate the equinox-debug.properties file with the one provided in shell/dev module
            properties.save();
        } catch (IOException e) {
            throw new RuntimeException("Error setting framework debugging: " + e.getMessage(), e);
        }
    }
View Full Code Here

        if (persist) {
            try {
                String etc = System.getProperty("karaf.etc");
                Properties props = new Properties(new File(etc, "system.properties"));
                props.put(key, value);
                props.save();
            } catch (IOException e) {
                throw new RuntimeException("Error persisting system property", e);
            }
        }
        return System.setProperty(key, value);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.