ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicola Ken Barozzi <>
Subject Re: Using files in classpath in task file=""
Date Fri, 04 Apr 2003 15:38:49 GMT

Stefan Bodewig wrote, On 04/04/2003 17.21:
> On Fri, 04 Apr 2003, Nicola Ken Barozzi <> wrote:
>>What I mean is not to change the passing of a File object.  I mean
>>that we can *wrap* an URL in a File. So we pass a File, and use an
>>URL, getting a Virtual File System.
> How so - put the URI into the name and abuse File as a String?  I'd
> really like to understand that.
> We are talking about here 8-)

Sure. Look at the JDK 1.4 version, it has this constructor:

   public File(URI uri)	

Why? Because a URI can be navigated, and it's possible to make a File 
from a URI.

We could do: extends

and make

   public File(String URI)

that also can accept a URI to create itself.

Look at all the methods of if I gave you just an url in 
the constructor, you could write almost, if not all, those methods.

So, if we make the method in the utils return a File that is in reality 
a but still used as a File, we could make all 
tasks that use a file be able to accept an url.

     url string
  -> in utils it's made into a
  -> it's given as a
  -> it's used as a, but the methods inside use the "VFS"

Am I really missing the obvious? Could as well be.

Nicola Ken Barozzi         
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)

View raw message