Re: CVS update: MODIFIED: util, CommonUtils.java ...
Adam Fisk <[email protected]> Mon, 03 Oct 2005 11:33:14 -0400
| Newsgroups | gmane.network.gnutella.limewire.core.devel |
|---|---|
| Message-ID | <[email protected]> |
You undoubtedly know this, but the below technique won't work on international systems. The best way is to access it using native code in the registry, but the Java Desktop Integration Project might have something that already does the JNI work for you. If you're not already familiar with it, check out: https://jdic.dev.java.net/ -Adam [email protected] wrote: > User: kmagdsick > Date: 05/10/03 10:55:34 > > Modified: com/limegroup/gnutella/util Tag: appdata_savedir-branch > CommonUtils.java > Log: > First draft of finding 'Application Data' dir on Windows. > > Revision Changes Path > No revision > > > No revision > > > 1.155.10.1 +12 -0 core/com/limegroup/gnutella/util/CommonUtils.java > > (In the diff below, changes in quantity of whitespace are not shown.) > > Index: CommonUtils.java > =================================================================== > RCS file: /cvs/core/com/limegroup/gnutella/util/CommonUtils.java,v > retrieving revision 1.155 > retrieving revision 1.155.10.1 > diff -u -B -b -b -r1.155 -r1.155.10.1 > --- CommonUtils.java 10 Jul 2005 18:06:14 -0000 1.155 > +++ CommonUtils.java 3 Oct 2005 14:55:34 -0000 1.155.10.1 > @@ -765,6 +765,18 @@ > "Library/Preferences"); > settingsDir = new File(tempSettingsDir, "LimeWire"); > } > + if(isWindows()) { > + if ((new File(getUserHomeDir(), "Application Data")).exists()) { > + File tempSettingsDir = new File(getUserHomeDir(), > + "Application Data\\LimeWire"); > + // Check for the legacy location of the LW preferences directory > + // on Windows. Use legacy data if available and the new > + // preferences directory doesn't exist. > + if (tempSettingsDir.exists() || !settingsDir.exists()) { > + settingsDir = tempSettingsDir; > + } > + } > + } > > if(!settingsDir.isDirectory()) { > settingsDir.delete(); // delete whatever it may have been > > > >_______________________________________________ >core-cvs mailing list >[email protected] >http://www.limewire.org/mailman/listinfo/core-cvs > > _______________________________________________ core-dev mailing list [email protected] http://www.limewire.org/mailman/listinfo/core-dev