java.util.prefs: storing the preferences somewhere else

Discussion in 'Java' started by Veerle, Oct 23, 2003.

  1. Veerle

    Veerle Guest

    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
    Veerle, Oct 23, 2003
    #1
    1. Advertising

  2. Veerle

    Daniel Dyer Guest

    On 23 Oct 2003 07:52:37 -0700, Veerle <> 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! =-----
    Daniel Dyer, Oct 23, 2003
    #2
    1. Advertising

  3. Veerle

    Roedy Green Guest

    On Thu, 23 Oct 2003 16:06:57 +0100, Daniel Dyer
    <> 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.
    Roedy Green, Oct 23, 2003
    #3
  4. Veerle

    Phil... Guest

    make an output stream and use method exportNode()
    it will output in xml format

    "Roedy Green" <> wrote in message
    news:...
    > On Thu, 23 Oct 2003 16:06:57 +0100, Daniel Dyer
    > <> 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.
    Phil..., Oct 24, 2003
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Oliver Hirschi

    java.util.prefs.Preferences

    Oliver Hirschi, Jul 16, 2003, in forum: Java
    Replies:
    8
    Views:
    8,748
    Chris Riesbeck
    Jul 16, 2003
  2. kimbuba

    java.util.prefs

    kimbuba, Jul 16, 2003, in forum: Java
    Replies:
    10
    Views:
    3,119
    kimbuba
    Jul 20, 2003
  3. Carsten Zerbst

    webstart and java.util.Preferences ?

    Carsten Zerbst, Jul 16, 2003, in forum: Java
    Replies:
    1
    Views:
    545
    S. Balk
    Jul 16, 2003
  4. Me
    Replies:
    1
    Views:
    410
    Manish Pandit
    Sep 29, 2006
  5. Roedy Green
    Replies:
    10
    Views:
    2,042
    Mark Thornton
    Dec 30, 2007
Loading...

Share This Page