java.util.prefs

K

kimbuba

Hello all.
I'm playing with this new api.

But i have some questions about it.

I read that in windows preferences resides in:
HKEY_CURRENT_USER\Software\JavaSoft\Prefs (for the user tree)
On linux plat pref resides in: <user's home directory>/.java/.userPrefs

The problem arises when i'm building a web application. If i write on the
system tree i could read and write others preferences!

My question is: is it possible to have a local pref tree? like a File? so
that i can store that file locally on my hosting space?
i'd like to be indipendent of my hosting provider, since i could have
problems in writing on System tree or User tree (if they didn't configure
well my account)

Thanx all in advance.
 
M

Mohun Biswas

Roedy said:
Is HKEY_CURRENT_USER an alias for whomever is actually signed on right
now?

Yes.

It seems when you poke around in the registry there are large
parts duplicated.
True.

I found Javasoft/prefs directories also in HKEY_LOCAL_MACHINE and
HKEY_USERS.

Sun loves to play the shell game.

That's as may be but what you describe is an artifact of the Windows
registry. Many of the per-user settings are "backed" by per-machine
settings in the HKEY_LOCAL_MACHINE tree. And in general, any search
through the registry turns up huge duplicate trees, presumably as a
result of some kind of aliasing/linking.

MB
 
M

Mohun Biswas

Roedy said:
Is HKEY_CURRENT_USER an alias for whomever is actually signed on right
now?

Yes.

It seems when you poke around in the registry there are large
parts duplicated.
True.

I found Javasoft/prefs directories also in HKEY_LOCAL_MACHINE and
HKEY_USERS.

Sun loves to play the shell game.

That's as may be but what you describe is an artifact of the Windows
registry. Many of the per-user settings are "backed" by per-machine
settings in the HKEY_LOCAL_MACHINE tree. And in general, any search
through the registry turns up huge duplicate trees, presumably as a
result of some kind of aliasing/linking.

MB
 
J

Joseph Millar

Is HKEY_CURRENT_USER an alias for whomever is actually signed on right
now? It seems when you poke around in the registry there are large
parts duplicated.

I found Javasoft/prefs directories also in HKEY_LOCAL_MACHINE and
HKEY_USERS.

Sun loves to play the shell game.

Sun's implementation of the Preferences on Windows
goes something like this:

User Root:
HKEY_CURRENT_USER\Software\JavaSoft\Prefs

System Root:
HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Prefs

The effect is that is you want to share preferences across
different users, put them in the System tree, not the User
tree. The User tree will change based on the currently
logged in user, so the preferences will necessarily be
different. THe HKEY_CURRENT_USER hive is actually an
alias for one of the hives in the HKEY_USERS hive, matching
whoever the current user is.

--Joe
 
A

Andy Flowers

Try looking at the Preferences & PreferencesFactory classes for details of
how you can provide your own preferences store.

kimbuba said:
is it possible to store the trees on a separate file?
If i put on the hosting's system tree, others people could read and modify
my preferences.

Thnx.





 
K

kimbuba

Try looking at the Preferences & PreferencesFactory classes for details of
how you can provide your own preferences store.

yes but in that way i'll break library standard.
I think i'm going to go with the java.util.Properties
I'll use preferences only for stand alone app.

Thnx.
 
P

Patrick Thrapp

K

kimbuba

i guess ur right.
I will try to understand java's Preferences implementation.

Thnx!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,765
Messages
2,569,568
Members
45,042
Latest member
icassiem

Latest Threads

Top