Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > java.util.prefs: storing the preferences somewhere else

Reply
Thread Tools

java.util.prefs: storing the preferences somewhere else

 
 
Veerle
Guest
Posts: n/a
 
      10-23-2003
Hi,

I would like to implement a subclass of the Preferences class that
doesn't store everything into the Windows registry, but in an xml
file. Does anyone have example code of
- a subclass of the Preferences class
- an implementation of PreferencesFactory for this Preferences class
- an implementation of both the listeners for this Preferences class
- and a small example program that uses the above?
This would be a great help when starting out my own implementation...
This sample code doesn't have to store the preferences in an xml file,
any other location than the Windows registry will do, it's just to get
an idea of how to start of with my own thing.

Thanks in advance,
Veerle
 
Reply With Quote
 
 
 
 
Daniel Dyer
Guest
Posts: n/a
 
      10-23-2003
On 23 Oct 2003 07:52:37 -0700, Veerle <(E-Mail Removed)> wrote:

> Hi,
>
> I would like to implement a subclass of the Preferences class that
> doesn't store everything into the Windows registry, but in an xml
> file. Does anyone have example code of
> - a subclass of the Preferences class
> - an implementation of PreferencesFactory for this Preferences class
> - an implementation of both the listeners for this Preferences class
> - and a small example program that uses the above?
> This would be a great help when starting out my own implementation...
> This sample code doesn't have to store the preferences in an xml file,
> any other location than the Windows registry will do, it's just to get
> an idea of how to start of with my own thing.
>
> Thanks in advance,
> Veerle



Well the Linux version of the JRE stores preferences in an XML file under
the user's home directory, so it might be worth investigating that. I
don't know if there's some property you can set to get it to behave this
way on Windows. If not, you can probably take a look in the source for
the Linux version and get some ideas from that.


--
Daniel Dyer
Empathy Software


-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
 
Reply With Quote
 
 
 
 
Roedy Green
Guest
Posts: n/a
 
      10-23-2003
On Thu, 23 Oct 2003 16:06:57 +0100, Daniel Dyer
<(E-Mail Removed)> wrote or quoted :

>Well the Linux version of the JRE stores preferences in an XML file under
>the user's home directory, so it might be worth investigating that. I
>don't know if there's some property you can set to get it to behave this
>way on Windows. If not, you can probably take a look in the source for
>the Linux version and get some ideas from that.


There is a problem with Windows and JNLP in that you don't get
assigned a directory to work in. There is no natural place to put
your file. You will have to invent some file-naming convention and
tree-like directory structure to store the preferences. Again you
might take a lead from how they pull it off in Linux.


--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
 
Reply With Quote
 
Phil...
Guest
Posts: n/a
 
      10-23-2003
make an output stream and use method exportNode()
it will output in xml format

"Roedy Green" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> On Thu, 23 Oct 2003 16:06:57 +0100, Daniel Dyer
> <(E-Mail Removed)> wrote or quoted :
>
> >Well the Linux version of the JRE stores preferences in an XML file under
> >the user's home directory, so it might be worth investigating that. I
> >don't know if there's some property you can set to get it to behave this
> >way on Windows. If not, you can probably take a look in the source for
> >the Linux version and get some ideas from that.

>
> There is a problem with Windows and JNLP in that you don't get
> assigned a directory to work in. There is no natural place to put
> your file. You will have to invent some file-naming convention and
> tree-like directory structure to store the preferences. Again you
> might take a lead from how they pull it off in Linux.
>
>
> --
> Canadian Mind Products, Roedy Green.
> Coaching, problem solving, economical contract programming.
> See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Redirecting hs_err_pidXXXX.log somewhere else Frank Cisco Java 0 06-01-2009 08:30 PM
Weblinks that kick around to somewhere else? Dean McDane Computer Support 7 06-26-2007 09:51 AM
storing pointer vs storing object toton C++ 11 10-13-2006 11:08 AM
creating a component somewhere else. atilagunes@gmail.com Java 1 08-31-2006 04:14 PM
Time zones: Pretending to be somewhere else Nathan Sokalski ASP .Net 8 01-23-2006 01:55 AM



Advertisments