Gnutella Forums  

Go Back   Gnutella Forums > Current Gnutella Client Forums > Phex (Cross-platform) > General Discussion
Register FAQ The Twelve Commandments Members List Calendar Arcade Find the Best VPN Today's Posts

General Discussion For anything which doesn't fit somewhere else (for PHEX users)


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old September 3rd, 2005
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 03:03 PM.
Reply With Quote
  #2 (permalink)  
Old November 30th, 2005
Apprentice
 
Join Date: September 3rd, 2005
Posts: 5
stax is flying high
Default

Nobody replying indicates a little bit windows users aren't really first class citizens here. Quite many people can't get along with applications that don't integrate with the system properly. I did some research for my own application, please read here . Quite a few people were seriously pissed of by applications that behave badly. You are only saving in the home dir when the desktop dir is within the home dir which is often not desirable and even if it's within the home dir you still doing it wrong because applications are not supposed to save in the home dir directly but in a sub dir called application data. The system provides various ways to get the path of application data directory. I live in Weilimdorf btw.

Last edited by stax; November 30th, 2005 at 05:09 AM.
Reply With Quote
  #3 (permalink)  
Old November 30th, 2005
On Holiday
 
Join Date: April 20th, 2005
Posts: 3,279
Only A Hobo is a great assister to others; your light through the dark tunnel
Default

There have been a lot of changes to Phex since your first post, and GregorK will, no doubt pick up on this post. If he misses it for some reason send him a pm.

As you can see I'm a mac user so this makes little sense to me
__________________
To get Phex Click on the Fox
Reply With Quote
  #4 (permalink)  
Old November 30th, 2005
arne_bab's Avatar
Draketo, small dragon.
 
Join Date: May 31st, 2002
Location: Heidelberg, Germany
Posts: 1,881
arne_bab is a great assister to others; your light through the dark tunnel
Default

I'm a Mac-User too, and the main-dev is a bit busy programming sometimes, so please don't gripe it, that he seems to have overlooked your post.

Besides: GregorK is Windows-User, so if you can contribute some ideas how to select the best folders in Windows without too much hassle for Java, I'm sure he'll be quite interested.
__________________

-> put this banner into your own signature! <-
--
Erst im Spiel lebt der Mensch.
Nur ludantaj homoj vivas.
GnuFU.net - Gnutella For Users
Draketo.de - Shortstories, Poems, Music and strange Ideas.
Reply With Quote
  #5 (permalink)  
Old November 30th, 2005
Phex Developer
 
Join Date: May 8th, 2001
Location: Stuttgart, Germany
Posts: 988
GregorK is flying high
Default

sorry for missing this thread...

This bug is not very easy to work around... not even at sun it is quite clear what is the best way to determine the correct directory across the different window plattforms.

To store the files in the application directory is also not a very good way when looking at systems used by multiple users.

Actually I currently have no idea how to solve this usefully.

For your problem you can work around by starting Phex with the option:

-c <path>

Copy your existing configuation files to the new location before starting.
__________________
Reply With Quote
  #6 (permalink)  
Old November 30th, 2005
Apprentice
 
Join Date: September 3rd, 2005
Posts: 5
stax is flying high
Default

Thanks and sorry if I was too much of a pain. I feel much better now and I hope the other Java developers I surely will point to this topic will provide a solution as well. If I ever find a solution (by now I know only Visual Studio languages) I'll report back.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why can't LimeWire just work already??! (Java) Savage X Windows 11 December 8th, 2006 06:05 PM
Limewire not running(REINSTALLING JAVA & LIMEWIRE DOESN'T WORK) quaid Getting Started Using LimeWire + WireShare 9 August 20th, 2006 11:38 PM
Limewire Keeps Closing Down: System prefered Java 1.4.2 over Java 1.5 CrAcKeDuP Connection Problems 13 February 22nd, 2005 04:49 AM
Exception in thread "main" java.lang.NoClassDefFoundError: lax/nl/java/option/java/st jllabres General Linux Support 6 October 17th, 2002 05:26 PM
Exception in thread "main" java.lang.NoClassDefFoundError: lax/nl/java/option/java/st jllabres General Linux Support 2 October 13th, 2002 02:06 AM


All times are GMT -7. The time now is 03:34 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 ©2011, Crawlability, Inc.

Copyright © 2020 Gnutella Forums.
All Rights Reserved.