1

I'm trying use Preferences API to save a path to file in regedit. It is works but the value of path is not saved correctly.

I'm trying this.

public class ImageLogoPreference { private final String path = "configs"; private Preferences node; public ImageLogoPreference(){ node = Preferences.userRoot().node(path); } public void setImageLogo(){ node.put("logo", "\\IguanaSistemas\\IguanaFight\\imagens\\logo.png"); } public String getImageLogo(){ String logo = node.get("logo", "image"); return logo; } } 

At register save this: ///Iguana/Sistemas///Iguana/Fight//imagens//logo.png

enter image description here Any idea ?

1
  • The API is auto formatting the value based on it's requirements, same thing happens to Properties when they are saved. Commented Aug 19, 2014 at 0:06

1 Answer 1

1

Doesn't matter.

Just get it in your Java program. You don't have a problem.

 Preferences node = Preferences.userRoot().node("config"); //node.put("logo", "\\IguanaSistemas\\IguanaFight\\imagens\\logo.png"); String s = node.get("logo", "blah"); System.out.println(s); 

Prints the correct string.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.