R
Rajarshi Guha
Hi, I have an app in which I'd like to keep track of multiple user
specified directories. In the past I have used a dot file in the users
home directory and simply parsed that.
However I'd like to use the Preferences API but I'm not sure how I can
handle this situation.
So for example I need to keep track of directories DIRA, DIRB and DIRC.
All of them would correspond to a dirEntries
So I could do something like:
Preferences prefs =
Preferences.userRoot().node("/net/guha/apps/cdkdesc/dirEntries") ;
However if I now go to do
prefs.put("Entry", "DIRA");
I can't put in the others using the same key.
One possibility I thought of using the hash() method for a given String,
but I'm not sure that will always be unique.
The only other approach I can think of is to make the key and the value
the same.
Are there any better approaches to this problem?
Thanks,
Rajarshi
specified directories. In the past I have used a dot file in the users
home directory and simply parsed that.
However I'd like to use the Preferences API but I'm not sure how I can
handle this situation.
So for example I need to keep track of directories DIRA, DIRB and DIRC.
All of them would correspond to a dirEntries
So I could do something like:
Preferences prefs =
Preferences.userRoot().node("/net/guha/apps/cdkdesc/dirEntries") ;
However if I now go to do
prefs.put("Entry", "DIRA");
I can't put in the others using the same key.
One possibility I thought of using the hash() method for a given String,
but I'm not sure that will always be unique.
The only other approach I can think of is to make the key and the value
the same.
Are there any better approaches to this problem?
Thanks,
Rajarshi