Return-Path: Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Delivered-To: mailing list dev@ant.apache.org Received: (qmail 85912 invoked from network); 4 Apr 2003 15:39:14 -0000 Received: from mail-3.tiscali.it (HELO mail.tiscali.it) (195.130.225.149) by daedalus.apache.org with SMTP; 4 Apr 2003 15:39:14 -0000 Received: from apache.org (62.10.48.77) by mail.tiscali.it (6.5.032) id 3E8AB72700179932 for dev@ant.apache.org; Fri, 4 Apr 2003 17:39:16 +0200 Message-ID: <3E8DA709.1040206@apache.org> Date: Fri, 04 Apr 2003 17:38:49 +0200 From: Nicola Ken Barozzi Reply-To: nicolaken@apache.org User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3) Gecko/20030312 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ant Developers List Subject: Re: Using files in classpath in task file="" References: <3E8B012A.6060604@apache.org> <3E8B2145.4090807@apache.org> <3E8DA0E8.1050709@apache.org> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N 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 java.io.File 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: org.apache.tools.vfs.File extends java.io.File and make public File(String URI) that also can accept a URI to create itself. Look at all the methods of java.io.File: 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 org.apache.tools.vfs.File 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 org.apache.tools.vfs.File -> it's given as a java.io.File -> it's used as a java.io.File, but the methods inside use the "VFS" Am I really missing the obvious? Could as well be. -- Nicola Ken Barozzi nicolaken@apache.org - verba volant, scripta manent - (discussions get forgotten, just code remains) ---------------------------------------------------------------------