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

P

Philipp Gressly

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 ??
 
C

carfield

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

Steve Sobol

Philipp said:
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 / (e-mail address removed) / PGP: 0xE3AE35ED

"The wisdom of a fool won't set you free"
--New Order, "Bizarre Love Triangle"
 
S

Steve Sobol

Steve said:
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 / (e-mail address removed) / PGP: 0xE3AE35ED

"The wisdom of a fool won't set you free"
--New Order, "Bizarre Love Triangle"
 
S

Steve Sobol

Steve said:
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 / (e-mail address removed) / PGP: 0xE3AE35ED

"The wisdom of a fool won't set you free"
--New Order, "Bizarre Love Triangle"
 
K

Knute Johnson

Philipp said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top