aspose file tools*
The moose likes Java in General and the fly likes windows Registry in java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "windows Registry in java" Watch "windows Registry in java" New topic
Author

windows Registry in java

Ami Choc
Greenhorn

Joined: Aug 06, 2012
Posts: 8
Can any one please tell me how to save the folder name in windows registry using java

want to write and read the folder name from registry

I cannot use properties files because i assume we cannot use it for program started with the WebStart technology. Please correct me i am wrong

Appreciate your help

Thanks in advance !!

Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18901
    
    8

If your Web Start application can't use a properties file on the client machine, then chances are you can't use the Windows registry there either. And anyway you can't access the registry (easily) from Java anyway. However, you could try using the Preferences class in the java.util.prefs package. (That's an excellent alternative to properties files in any Java application.) To tell you the truth I'm not sure whether that will work either, but you should try it.

However what's this folder name you want to save? If your Web Start application can't access the file system on the client machine, then what folder is that?
Ami Choc
Greenhorn

Joined: Aug 06, 2012
Posts: 8
Basically want to define a folder on client machine where we should keep all the files now there are couple of ways to achieve

but we are choosing registry because we do not want to force client to install on C:..it can be any DRIVE as per client computer

so how to dynamically detect the primary drive and create folder if does not exist?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18901
    
    8

If you use a JFileChooser then the user can choose any folder they like, on any drive, and create a new one if they want to do that. So I would leave it to the user to do that.

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: windows Registry in java