• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

windows Registry in java

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 !!

 
Marshal
Posts: 27214
87
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Marshal
Posts: 27214
87
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

 
Beauty is in the eye of the tiny ad.
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic