preferences blocked by windows registry?

D

Daisy

I have a small desktop application that writes 2 Strings to the user
portion of Java preferences. On some Windows machines, the save does
not actually save a value. My early analysis indicates Registry
security blocks the write. Is there some work around?

Thanks

Daisy

public class GuiPreferences {

private static final String IP_ADDRESS = "ip_address";

public GuiPreferences() {

Preferences preferences =

Preferences.userNodeForPackage(GuiPreferences.class );

preferences.put( IP_ADDRESS , "10.1.10.1" );

// this returns null
String retrievedIp = preferences.get( IP_ADDRESS , null );
}
}
 
I

Ingo R. Homann

Hi Daisy,
I have a small desktop application that writes 2 Strings to the user
portion of Java preferences. On some Windows machines, the save does
not actually save a value. My early analysis indicates Registry
security blocks the write. Is there some work around?

Thanks

Daisy

public class GuiPreferences {

private static final String IP_ADDRESS = "ip_address";

public GuiPreferences() {

Preferences preferences =

Preferences.userNodeForPackage(GuiPreferences.class );

preferences.put( IP_ADDRESS , "10.1.10.1" );

// this returns null
String retrievedIp = preferences.get( IP_ADDRESS , null );
}
}

There is a flush() method and a sync() method. Perhaps they will solve
your problem.

Ciao,
Ingo
 

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

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,197
Latest member
ScottChare

Latest Threads

Top