Examples of exportSubtree()


Examples of java.util.prefs.Preferences.exportSubtree()

    @SuppressWarnings("unused")
    public static void printPrefNode(Class<? extends TotalReport> reportClass)
            throws NoSuchFieldException, IllegalAccessException, IOException, BackingStoreException {
        Preferences thisPrefNode = Prefs.REPORT_CONFIG_PREFS.node(getReportTypeName(reportClass));
        try (ByteArrayOutputStream baos = new ByteArrayOutputStream()) {
            thisPrefNode.exportSubtree(baos);
            String outString = baos.toString("UTF-8");
            System.out.println(outString);
        }
    }
View Full Code Here

Examples of java.util.prefs.Preferences.exportSubtree()

        // we'll restore the original values in that case.

        try {
            Preferences preferences_node = getPreferencesNode();
            ByteArrayOutputStream backup = new ByteArrayOutputStream();
            preferences_node.exportSubtree(backup);
            preferences_node.clear();

            // now load in the preferences
            try {
                Preferences.importPreferences(config_file_input_stream);
View Full Code Here

Examples of java.util.prefs.Preferences.exportSubtree()

        // because otherwise the agent will not be able to re-register with any previous name is was registered with.

        Preferences prefNode = getPreferencesNode();
        String securityToken = prefNode.get(AgentConfigurationConstants.AGENT_SECURITY_TOKEN, null);
        ByteArrayOutputStream backup = new ByteArrayOutputStream();
        prefNode.exportSubtree(backup);
        prefNode.clear();

        // now load in the preferences
        try {
            ByteArrayOutputStream rawConfigFile = new ByteArrayOutputStream();
View Full Code Here

Examples of java.util.prefs.Preferences.exportSubtree()

        // Note that we squirrel away any security token we already have - we need to preserve this when we can
        // because otherwise the agent will not be able to re-register with any previous name is was registered with.
        Preferences preferencesNode = getPreferencesNode();
        String securityToken = preferencesNode.get(AgentConfigurationConstants.AGENT_SECURITY_TOKEN, null);
        ByteArrayOutputStream backup = new ByteArrayOutputStream();
        preferencesNode.exportSubtree(backup);
        preferencesNode.clear();

        // now load in the preferences
        try {
            ByteArrayOutputStream raw_config_file = new ByteArrayOutputStream();
View Full Code Here

Examples of java.util.prefs.Preferences.exportSubtree()

        // But first we need to backup these original preferences in case the config file fails to load -
        // we'll restore the original values in that case.

        Preferences preferencesNode = getTemplatePreferencesNode();
        ByteArrayOutputStream backup = new ByteArrayOutputStream();
        preferencesNode.exportSubtree(backup);
        preferencesNode.clear();

        // now load in the preferences
        try {
            Preferences.importPreferences(configFileInputStream);
View Full Code Here

Examples of java.util.prefs.Preferences.exportSubtree()

    File outFile = new File (file.getParentFile (),
                             file.getName ().substring (0, file.getName().length () - 4) + ".out.xml");
    BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream (outFile));
    try {
      prefs.exportSubtree (out);
    }
    catch (BackingStoreException exc) {
      myLog.error ("exportPrefs", exc);
    }
View Full Code Here

Examples of java.util.prefs.Preferences.exportSubtree()

      p.exportNode(null);
    } catch (IOException e6) {
    } catch (BackingStoreException e6) {
    }
    try {
      p.exportSubtree(null);
    } catch (IOException e7) {
    } catch (BackingStoreException e7) {
    }
    try {
      p.flush();
View Full Code Here

Examples of java.util.prefs.Preferences.exportSubtree()

        final Preferences prefs = Preferences.userNodeForPackage(FavouriteConnections.class);
       
        OutputStream os = null;
        try {
            os = new FileOutputStream(f);
            prefs.exportSubtree(os);
        } finally {
            if(os != null) {
                try {
                   os.close();
                } catch(final IOException ioe) {
View Full Code Here

Examples of java.util.prefs.Preferences.exportSubtree()

            p.exportNode(null);
        } catch (IOException e6) {
        } catch (BackingStoreException e6) {
        }
        try {
            p.exportSubtree(null);
        } catch (IOException e7) {
        } catch (BackingStoreException e7) {
        }
        try {
            p.flush();
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.