Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java Preferences API using a custom file?

Is it possible to use Preferences API to store my application's settings in a custom file? From what I have read, in Windows preferences are stored in registry which is not a good idea imho and I want my app to save prefs to let's say D:\app.preferences. Is it possible?

like image 688
BartoszCichecki Avatar asked Oct 30 '11 20:10

BartoszCichecki


1 Answers

the point of the Preferences API is to make it so that the application programmer doesn't have to know anything about how the OS chooses to save user preferences. if you want to save preferences in a specific file, you can certainly do that. just use a Properties instance to read/write to the file you desire.

like image 178
jtahlborn Avatar answered Sep 28 '22 00:09

jtahlborn