Java Preference Remove removeCLOB(Preferences prefs, String key)

Here you can find the source of removeCLOB(Preferences prefs, String key)

Description

Removes the character large object (CLOB) associated with the specified key in the given preference node, if any.

License

Open Source License

Parameter

Parameter Description
prefs the preferences node where data is stored
key the key the CLOB was associated with

Declaration

public static void removeCLOB(Preferences prefs, String key) 

Method Source Code


//package com.java2s;
// modify it under the terms of the GNU Lesser General Public License

import java.util.prefs.BackingStoreException;
import java.util.prefs.Preferences;

public class Main {
    /**//from w  w w  .  j  av  a 2s  .  com
     * Removes the character large object (CLOB) associated with the specified
     * key in the given preference node, if any.
     * 
     * @param prefs the preferences node where data is stored
     * @param key the key the CLOB was associated with
     */
    public static void removeCLOB(Preferences prefs, String key) {
        prefs.remove(key);
        try {
            getClobStorage(prefs, key).removeNode();
        } catch (BackingStoreException bse) {
        }
    }

    private static Preferences getClobStorage(Preferences prefs, String key) {
        return prefs.node(key + "_clob");
    }
}

Related

  1. removeAll(Preferences prefs, boolean deep)
  2. removeKeys(Preferences prefs, String key, int from, int to)
  3. removePref(String prefName, Object obj)
  4. resetPreferences()