간단한 메소드만 몇개 정리해봤습니다.
이정도면 쓸만하겠죠?
import java.util.prefs.BackingStoreException;
import java.util.prefs.Preferences;
public class Main
{
private static Preferences pref;
public static void main(String[] args) throws BackingStoreException
{
pref = Preferences.userRoot();
}
public static void setValue(String key, String value)
{
pref.put(key, value);
}
public static String getValue(String key)
{
return pref.get(key, null);
}
public static boolean hasValue(String key)
{
return pref.get(key, null) != null;
}
public static void showKeyValue() throws BackingStoreException
{
String[] keys = pref.keys();
for(int i=0; i
System.out.println("key : "+keys[i]+" value : "+pref.get(keys[i], null));
}
public static void removeValue(String key)
{
pref.remove(key);
}
}