Can I get "My Document", "Desktop" and "Favourite" folder dynamically?

Discussion in 'Java' started by Philipp Gressly, Apr 17, 2005.

  1. wrote:
    > In difference language of Windows, they have difference name, can I get
    > them dynamically from java? Any API can do this?
    >

    I just now it from "My Documents". This is the System Property "user.home".
    Because i am using Linux with the "windowmaker" Desktop, I have no Idea,
    what the other two ("Desktop", and "Favourite") could mean. Probably
    theese two are MsWindows specific ??
    Philipp Gressly, Apr 17, 2005
    #1
    1. Advertising

  2. Philipp Gressly

    Guest

    In difference language of Windows, they have difference name, can I get
    them dynamically from java? Any API can do this?
    , Apr 17, 2005
    #2
    1. Advertising

  3. Philipp Gressly

    Steve Sobol Guest

    Philipp Gressly wrote:

    >> In difference language of Windows, they have difference name, can I get
    >> them dynamically from java? Any API can do this?
    >>

    > I just now it from "My Documents". This is the System Property "user.home".


    The actual locations of those folders would be stored in the system registry,
    which can be read with native Windows functions. You'd need to use JNI, or look
    on Google for a package that is already written that uses JNI to do it. I
    haven't had the occasion to look for such a package, but I know they're out
    there. :) Here's a Google query that should work:

    java "windows registry"

    (make sure you enclose "windows registry" in double quotes)

    Also, after clicking around a bit, I found:

    http://www.lattelib.com/

    The Windows library provides a Java class that can query and set registry
    settings and environment variables. (I'd use JNI to query/set environment
    variables, myself, but... this library might be useful for the registry
    features. Haven't tried it myself yet.)

    --
    JustThe.net - Apple Valley, CA - http://JustThe.net/ - 888.480.4NET (4638)
    Steven J. Sobol, Geek In Charge / / PGP: 0xE3AE35ED

    "The wisdom of a fool won't set you free"
    --New Order, "Bizarre Love Triangle"
    Steve Sobol, Apr 17, 2005
    #3
  4. Philipp Gressly

    Steve Sobol Guest

    JNDI, was Re: Can I get "My Document", "Desktop" and "Favourite"folder dynamically?

    Steve Sobol wrote:

    > The Windows library provides a Java class that can query and set
    > registry settings and environment variables. (I'd use JNI to query/set
    > environment variables, myself, but... this library might be useful for
    > the registry features. Haven't tried it myself yet.)


    Hm. Now that I think about it, has anyone created a JNDI interface to the
    Windows Registry? :)

    --
    JustThe.net - Apple Valley, CA - http://JustThe.net/ - 888.480.4NET (4638)
    Steven J. Sobol, Geek In Charge / / PGP: 0xE3AE35ED

    "The wisdom of a fool won't set you free"
    --New Order, "Bizarre Love Triangle"
    Steve Sobol, Apr 17, 2005
    #4
  5. Philipp Gressly

    Steve Sobol Guest

    Steve Sobol wrote:

    > The Windows library provides a Java class that can query and set
    > registry settings and environment variables. (I'd use JNI to query/set


    gah. JNDI, not JNI.

    --
    JustThe.net - Apple Valley, CA - http://JustThe.net/ - 888.480.4NET (4638)
    Steven J. Sobol, Geek In Charge / / PGP: 0xE3AE35ED

    "The wisdom of a fool won't set you free"
    --New Order, "Bizarre Love Triangle"
    Steve Sobol, Apr 17, 2005
    #5
  6. Philipp Gressly wrote:

    > wrote:
    >
    >> In difference language of Windows, they have difference name, can I get
    >> them dynamically from java? Any API can do this?
    >>

    > I just now it from "My Documents". This is the System Property "user.home".
    > Because i am using Linux with the "windowmaker" Desktop, I have no Idea,
    > what the other two ("Desktop", and "Favourite") could mean. Probably
    > theese two are MsWindows specific ??


    user.home is not My Documents, at least on my computer it isn't. I
    would be really curious to know if it really is on yours.

    public class test {
    public static void main(String[] args) {
    System.out.println(System.getProperty("user.home"));
    }
    }

    Output is:
    C:\Documents and Settings\Knute Johnson
    on my XPsp2 computer.

    --

    Knute Johnson
    email s/nospam/knute/
    Knute Johnson, Apr 17, 2005
    #6
    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. TC
    Replies:
    4
    Views:
    644
    JohnnyAppleseed
    Feb 7, 2005
  2. Andy Dingley

    Menu bar - that old favourite

    Andy Dingley, Jul 27, 2005, in forum: HTML
    Replies:
    3
    Views:
    530
  3. Dominic
    Replies:
    2
    Views:
    281
    Gunnar Peipman
    Dec 26, 2004
  4. John Carter
    Replies:
    5
    Views:
    125
    John Carter
    Sep 6, 2007
  5. iMath
    Replies:
    7
    Views:
    1,037
    iMath
    Nov 10, 2013
Loading...

Share This Page