Hi Robin,
thank's for your support !!!!
> I recently tried to set up JOELib to run on my windows 2000 machine. Everything compiled alright, but none of the examples would run correctly. I thought you might like to know about the problem and how I fixed it.
>
> I traced the problem back to the wsi.ra.tool.ResourceLoader class. It turns out that it was storing the file location as a URL, which converted the spaces in my file path into "%20"s. Since I installed JOELib in the Program Files directory, it tried to load files from Program%20Files, and failed.
>
> There are many ways to solve this problem, but I used the regex package and made the following changes:
>
> Line 33 - import java.util.regex.*;
> Line 115 -
> String locationString = location.getFile(); //must use getFile(), not toString() for windows
> // Replace every %20 with a space
> Pattern p = Pattern.compile("%20"); // searching pattern
> Matcher m = p.matcher(locationString);
> locationString = m.replaceAll(" "); // replacement string
> Line 156 -
> logger.debug("Loading from file " + locationString + ".");
> return getBytesFromFile(locationString); // changed from location.getFile()
Look's perfect !
For i've just added the regex-replacement directly before line 156,
because these changes are only necessary for files and not for resources
files in a zip or jar archive.
> This solved the problem. I don't, however, know if these changes cause any problems with other configurations or situations.
Let's see !;-)
> In case you want to incorporate these changes, I attached the modified ResourceLoader.java file.
I've added the changes locally and will add these things to CVS and
release a new version with further bug fixes in the next days, e.g. in the
number formatter when occuring NaN and some little parameter extensions
for the SMARTS parser and SMILES generator ...
... i've found also bugs in the .bat files, these will do nothing because
there is a useless goto statement directly to the end of .bat files, but i
would recommend Cygwin+.sh-scripts also ...
> Thanks,
> Robin Friedman
I've to thank you ...
Friendly regards, Joerg
>
> <<ResourceLoader.java>>
>
Dipl. Chem. Joerg K. Wegner
Univ. Tuebingen, Computer Architecture, Sand 1, D-72076 Tuebingen, Germany
Tel. (+49/0) 7071 29 78970, Fax (+49/0) 7071 29 5091
E-Mail: mailto:we...@in...
WWW: http://www-ra.informatik.uni-tuebingen.de
|