[kepler-dev] [Fwd: Re: kepler/src/util URLToLocalFile.java]

Kevin Ruland kruland at ku.edu
Thu Feb 2 12:40:45 PST 2006


Well,  it seems I cannot reproduce the problem Efrat was having.  Maybe 
that was a data problem.  However, even with the test workflow, and the 
previous revision of URLToLocalFile, I cannot reproduce the problem.

Kevin
>
> Dan,
>
> I was talking to Efrat a while ago, and I think this fix actually 
> covers up a bug in ptII's ptolemy.util.FileUtilities.nameToURL() which 
> appears to add an extra "/" to the string, which then makes the name 
> look like this:  "http:///www".  What this really indicates to Java 
> when converted to a URL, is protocol = http, host = null (localhost), 
> file = "/www", then if this URL is converted back into a string you 
> get this:  "http:/www" because of the null host.
>
> I've cc'd the ptolemy-hackers list because they might should look at 
> this.  The bug was introduced in r1.28 of that file.
>
> Kevin
>
> Daniel Higgins wrote:
>>   +
>>   +// jan2706: fix the "http:/www..." problem:
>>   +        try {
>>   +            String fixedUrlAsString =   +                
>> url.toString().replaceFirst("(https?:)//?", "$1//" );
>>   +            url = new URL( fixedUrlAsString );
>>   +        } catch( Exception e ) {
>>   +            System.out.println( "Badly formed url exception: " + e );
>>   +        }
>>   +
>>   +//System.out.println( "URLToLocalFile2: 
>> url.toString()="+url.toString() );
>>   
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Kepler-dev mailing list
> Kepler-dev at ecoinformatics.org
> http://mercury.nceas.ucsb.edu/ecoinformatics/mailman/listinfo/kepler-dev
>   



More information about the Kepler-dev mailing list