Re: [Geotools-devel] Converting java.net.URLs to java.io.Files

2007-06-22 Thread Jody Garnett
Understood - so the idea here is to track the problem down at the start. Do not make URLs that suck. I have made the change to the uDig code base - and will have a look at how often file.toURL() is used in GeoTools. Jody > Yes, going from File to URL is easy. The problem is going from URL to Fil

Re: [Geotools-devel] Converting java.net.URLs to java.io.Files

2007-06-22 Thread Richard Gould
Yes, going from File to URL is easy. The problem is going from URL to File. On Thu, 21 Jun 2007 19:18:49 -0700 Jody Garnett <[EMAIL PROTECTED]> wrote: > I just found that File.toURL() is deprecated (in Java 6): > > @deprecated This method does not automatically escape characters that > > * a

Re: [Geotools-devel] Converting java.net.URLs to java.io.Files

2007-06-21 Thread Jody Garnett
I just found that File.toURL() is deprecated (in Java 6): > @deprecated This method does not automatically escape characters that > * are illegal in URLs. It is recommended that new code convert an > * abstract pathname into a URL by first converting it into a URI, > via the > * [E

Re: [Geotools-devel] Converting java.net.URLs to java.io.Files

2007-06-19 Thread Jody Garnett
Richard Gould wrote: > I'm sticking it in DataUtilities and I will add this to the coding > conventions. > > On the GeoTools wiki: > http://docs.codehaus.org/display/GEOT/5.1.6+Converting+URLs+to+Files > And I created a section on the uDig Wiki for Coding Conventions: > http://udig.refractions.n

Re: [Geotools-devel] Converting java.net.URLs to java.io.Files

2007-06-19 Thread Richard Gould
I'm sticking it in DataUtilities and I will add this to the coding conventions. On the GeoTools wiki: http://docs.codehaus.org/display/GEOT/5.1.6+Converting+URLs+to+Files And I created a section on the uDig Wiki for Coding Conventions: http://udig.refractions.net/confluence/display/DEV/5.+Coding

Re: [Geotools-devel] Converting java.net.URLs to java.io.Files

2007-06-18 Thread Jody Garnett
Nice catch Richard - you could add this method to DataUtilities :-) Jody - 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 d

[Geotools-devel] Converting java.net.URLs to java.io.Files

2007-06-18 Thread Richard Gould
I am doing testing against trying to view/edit/manipulate files that reside on a windows network share, and I have run into several instances across both uDig and GeoTools where java.net.URLs are (improperly?) converted into java.io.Files. The usual method of doing this is to just use URL.getPat