KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > admin > PrefStomper


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tc.admin;
5
6 import java.util.prefs.Preferences JavaDoc;
7
8 public class PrefStomper {
9   public static void main(String JavaDoc[] args) throws Exception JavaDoc {
10     Preferences JavaDoc prefs = Preferences.userRoot();
11     String JavaDoc[] children = prefs.childrenNames();
12
13     for(int i = 0; i < children.length; i++) {
14       System.out.println("Removing " + children[i]);
15       prefs.node(children[i]).removeNode();
16     }
17
18     prefs.flush();
19   }
20 }
21
Popular Tags