Package java.util.prefs

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


*/
public class ClearGuiSaveState {

    public static void main(String args[]) throws BackingStoreException {
        Preferences p = Preferences.userNodeForPackage(GUISaveState.class);
        p.clear();
    }

}
View Full Code Here


    protected void store() {
        Preferences prefs = getPreferences();

        // clear the backing store
        try {
            prefs.clear();
        } catch (BackingStoreException ex) {
        }

        for (int i = 0; i < mruFileList.size(); i++) {
            String str = mruFileList.get(i);
View Full Code Here

        prefs.put(key, getCheckVal(clob));

        // Create a child node specifically for "clob storage" for this key
        Preferences p = getClobStorage(prefs, key);
        try {
            p.clear();
        } catch (BackingStoreException bse) {
            // it would be nice to clear all data underneath the clob storage
            // node since it might reduce our resource utilization.  But even
            // if this fails, the code below ought to cover our bases.
        }
View Full Code Here

        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

        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();
            InputStream rawConfigInputStream = configFile.openStream();
View Full Code Here

            if (default_prefs != null) {
                default_prefs.clear();
            }

            if (test_prefs != null) {
                test_prefs.clear();
            }

            File dataDir = new File(AgentConfigurationConstants.DEFAULT_DATA_DIRECTORY);

            if (dataDir != null) {
View Full Code Here

        // 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();
            StreamUtil.copy(config_file_input_stream, raw_config_file, true);
View Full Code Here

        int startPort = getStartPort();

        for (int i = 0; i < count; i++) {
            // get the spawned agent's config and clear it out of any old config that might still exist
            Preferences prefs = getPreferencesNode(i);
            prefs.clear();

            // start out by giving the spawned agent the template configuration
            for (String key : templatePrefs.keys()) {
                prefs.put(key, templatePrefs.get(key, "**SHOULD NEVER SEE THIS**"));
            }
View Full Code Here

        // 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

     */
    public void save(Preferences preferences) {

        Preferences recentNode = preferences.node(SETTINGS_RECENT_WORKSPACES);
        try {
            recentNode.clear();
        } catch (BackingStoreException e) {
        }
        int count = 0;
        Iterator it = recentWorkspaces.iterator();
        while (it.hasNext()) {
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.