Package org.apache.felix.utils.properties

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


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

    /**
     * Trigger felix fileinstall to update the config so there is no delay till it polls the file
View Full Code Here


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

            users.put(user, userInfos);
            try {
                if (debug) {
                    LOGGER.debug("Store the users properties file.");
                }
                users.save();
            } catch (IOException ioe) {
                LOGGER.warn("Unable to write user properties file {}", f, ioe);
            }
            storedPassword = encryptedPassword;
        }
View Full Code Here

            for (String key : propertiesToRemove) {
                p.remove(key);
            }
            // save the cfg file
            storage.mkdirs();
            p.save();
            updateFileInstall(storageFile);
        } else {
            Configuration cfg = configurationAdmin.getConfiguration(pid, null);
            if (cfg.getProperties() == null) {
                String[] pids = parsePid(pid);
View Full Code Here

                    if (addTransitiveFeatures) {
                        addMissingDependenciesToRepo();
                    }
                    FileOutputStream out = new FileOutputStream(featuresCfgFile);
                    try {
                        properties.save(out);
                    } finally {
                        out.close();
                    }
                }
            } else {
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 settting 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

            // TODO populate the equinox-debug.properties file with the one provided in shell/dev module
        } else {
            properties.remove("felix.log.level");
            properties.remove("osgi.debug");
        }
        properties.save();
    }

    public String getFramework() {
        if (bundleContext.getBundle(0).getSymbolicName().contains("felix")) {
            return "felix";
View Full Code Here

    public void setFramework(String framework) throws Exception {
        Properties properties = new Properties(new File(System.getProperty("karaf.etc"), "config.properties"));
        if (!framework.equals("felix") || !framework.equals("equinox"))
            throw new IllegalArgumentException("Framework name is not supported. Only felix or equinox are supported.");
        properties.put("karaf.framework", framework);
        properties.save();
    }

    public void setStartLevel(int startLevel) {
        Bundle b = getBundleContext().getBundle(0);
        FrameworkStartLevel fsl = (FrameworkStartLevel) b.adapt(FrameworkStartLevel.class);
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.