View Single Post
  #1 (permalink)  
Old September 3rd, 2005
stax stax is offline
Apprentice
 
Join Date: September 3rd, 2005
Posts: 5
stax is flying high
Default please work around this Java bug

Hi,

I just found Phex and dumped all my other P2P applications, cool. There is however a little problem. Phex determines the directory to save settings using this Java function:

getProperty("user.home")

this method got it all wrong, it reads a reg key to get the desktop dir and return the parent of it. On my system it returns "D:\" and I have a hard time to get along with this. My desktop dir is not within my user dir because I moved it outside, for the Windows world this is unproblematic but only if you don't use any Java applications. I must admit this might sound niggling, I'm trying to organize my files in a well thought out hierarchy.

On Windows the proper way to determine the directory where applications are supposed to save their settings is using the SHGetFolderPath Win32 API function with CSIDL_APPDATA as parameter. There is also a csidl for what a Linux user would understand as home directory (CSIDL_PROFILE) which would have been the correct implementation for getProperty("user.home").

Maybe the easiest way to get this dir with Java is expanding the %APPDATA% environment variable which Java might be capable (I don't know Java, unfortunately).

Imho applications should consider more simplicity, there's nothing easier then doing things the xcopy way but that's a very big story.

Regards,
stax

Last edited by stax; September 4th, 2005 at 04:03 PM.
Reply With Quote