From: Patrick N. (JIRA) <ji...@co...> - 2010-10-27 09:06:14
|
DataUtilities.urlToFile doesn't handle network paths correctly -------------------------------------------------------------- Key: GEOT-3300 URL: http://jira.codehaus.org/browse/GEOT-3300 Project: GeoTools Issue Type: Bug Components: data Affects Versions: 2.6.5 Reporter: Patrick Nagelschmidt Priority: Minor Currently in uDig you can open a map from a windows network share (samba) without problems, but if you save and re-open the project again the path is treated as local and the file not found. The culprit seems to be {{org.geotools.data.DataUtilities.urlToFile}}. If you create an URL object containing a windows network share like this {noformat} new URL("file", "////oehhwsfs09", "/some/path/on/the/server/filename.nds"); {noformat} and pass it to {{org.geotools.data.DataUtilities.urlToFile(URL)}}, as it's done automatically if e.g. uDig saves a project, the {{URL}} object will be transformed into a plain string and that will be passed to the {{File}} constructor. This works, i.e. the file can be opened, but from that point on the file's network nature is lost, which means the filesystem normalizer of {{Java.io.File}} will remove the leading double slashes and threat the file as local. Imo you should call {{Java.io.File(URI)}} instead of {{Java.io.File(String)}} at the end of {{urlToFile}} to make sure a set authority field in the {{URL}} is preserved. -- 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 |