• Post Reply Bookmark Topic Watch Topic
  • New Topic

Bad file path  RSS feed

 
vinny kapoor
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am trying to solve a following problem:

The default location of the file is ${user.home} and i need to display the location in good format
like c:\projects\myLocation
but at the moment i am getting a bad path as c:\projects\${user.home}

I am not sure how it could be done.

Your help will be appriciated.

Thanks
vinny
 
Rajat Jindal
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you please tell us more information what exactly are you doing ?
 
vinny kapoor
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I have a registry preference entry which stores the default location of one of the file location. The default values is
inputted as ${user.home}.

The problem is to show this path as an absolute path. I am running my program from D:\projects so when i am trying to display path
it is showing me as D:\projects\${user.home}

When i click on the browse button to go to the location pointed , it takes me to 'My Documents' directory which is Window's default value for user.home directory.

It would be ideal for me if i can display it as C:\Documents and Settings\user\My Documents.
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out System#getProperty
 
vinny kapoor
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Maneesh for replying. This will only work if the only possible value for registry entry is ${user.home} .
But user might change this value by changing the last saved directory location using filechooser.

Thus this strategy will fail.
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The user.home system property cannot be changed by the file chooser.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!