Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 40128 invoked from network); 19 Aug 2005 12:14:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 19 Aug 2005 12:14:09 -0000 Received: (qmail 1460 invoked by uid 500); 19 Aug 2005 12:14:03 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 1430 invoked by uid 500); 19 Aug 2005 12:14:03 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 1417 invoked by uid 99); 19 Aug 2005 12:14:03 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Aug 2005 05:14:03 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [138.96.64.20] (HELO sophia.inria.fr) (138.96.64.20) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Aug 2005 05:14:22 -0700 Received: from localhost (localhost [127.0.0.1]) by sophia.inria.fr (8.13.4/8.13.4) with ESMTP id j7JCE026009205 for ; Fri, 19 Aug 2005 14:14:00 +0200 Received: from [138.96.66.4] (dahu.inria.fr [138.96.66.4]) by sophia.inria.fr (8.13.4/8.13.4) with ESMTP id j7JCDrvn009179 for ; Fri, 19 Aug 2005 14:13:53 +0200 Message-ID: <4305CD01.3090705@sophia.inria.fr> Date: Fri, 19 Aug 2005 14:13:53 +0200 From: Philippe Poulard User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.7) Gecko/20050511 X-Accept-Language: fr-FR,en MIME-Version: 1.0 To: Jakarta Commons Users List Subject: Re: [VFS] bug ? References: <43059352.6090007@sophia.inria.fr> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (sophia.inria.fr [138.96.64.20]); Fri, 19 Aug 2005 14:13:53 +0200 (MEST) X-Virus-Scanned: by amavisd-new at sophia.inria.fr X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Torsten Curdt wrote: > > On 19.08.2005, at 10:07, Philippe Poulard wrote: > >> hi Mario, >> >> there is a bug in VFS RC3 : >> >> StandardFileSystemManager fsm = null; >> fsm = (StandardFileSystemManager) VFS.getManager(); >> fsm.setBaseFile( new File( System.getProperty( "user.dir" ) ) ); >> fsm.setDefaultProvider( new UrlFileProvider() ); >> FileObject fo = fsm.resolveFile( "file:///path/to/file" ); >> System.out.println( fsm.resolveFile( fo, "file:///chemin/vers/ >> fichier" ) ); >> System.out.println( fsm.resolveFile( fo, "/chemin/vers/fichier" ) ); >> System.out.println( fsm.resolveFile( fo, "chemin/vers/fichier" ) ); >> >> output is : >> >> file:///chemin/vers/fichier >> file:///chemin/vers/fichier >> file:///path/to/file/chemin/vers/fichier >> >> the last must be : >> >> file:///path/to/chemin/vers/fichier >> >> the same with java.net.URI gives the right result : >> >> URI uri = new URI( "file:///path/to/file" ); >> System.out.println( uri.resolve( "file:///chemin/vers/fichier" ) ); >> System.out.println( uri.resolve( "/chemin/vers/fichier" ) ); >> System.out.println( uri.resolve( "chemin/vers/fichier" ) ); > > > Maybe the URI class is a bit smarter > but why would you use a *file* as a > base anyway???? well, it's somewhat obvious : when you load an HTML document from a web server, you have : http://www.acme.com/path/to/document.html if the document contain : both will be resolved according to the document location : http://www.acme.com/path/to/picture.jpg http://www.acme.com/path/to/style.css i think there are many other examples where FILES are referencing resources they are using > > VFS should probably check whether it's > a dir and if not use the parent. this is not a question of "is it a dir or a file" if it doesn't end with "/", it must be resolved regarding the parent if it ends with "/", just append the relative path > > But IMHO the above example looks more > like a wrong use of the API. see RFCxxx about URIs > > my 2 cents > > cheers > -- > Torsten thanks for your reply -- Cordialement, /// (. .) -----ooO--(_)--Ooo----- | Philippe Poulard | ----------------------- --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org