WorldImageReader does not convert from URL to File properly
-----------------------------------------------------------
Key: GEOT-1336
URL: http://jira.codehaus.org/browse/GEOT-1336
Project: GeoTools
Issue Type: Bug
Components: gc imageio
Affects Versions: 2.3.2, 2.2.2
Environment: Affects windows only
Reporter: Richard Gould
Assignee: Richard Gould
Fix For: 2.2.3, 2.4-M4, 2.3.3
The WorldImageReader does not convert URLs to File correctly. It ignores the
authority property of the URL which contains information about which drive or
network host the file is located on. It is also likely that this problem is
pervasive in GeoTools.
The problem is that it constructs java.io.File using only URL.getFile(), but
URL.getAuthority() contains the drive/network host info (ie: "E:",
"\\fooServer"). The solution is to construct the URL as such:
String auth = url.getAuthority();
String path = url.getPath();
File f = null;
if (auth != null && !auth.equals("")) {
f = new File("//"+auth+path);
} else {
f = new File(path);
}
This problem persists in 2.2.x, 2.3.x, and 2.4.x.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel