Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 3667 invoked from network); 9 Feb 2005 13:25:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 9 Feb 2005 13:25:50 -0000 Received: (qmail 47391 invoked by uid 500); 9 Feb 2005 13:25:47 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 47329 invoked by uid 500); 9 Feb 2005 13:25:46 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 47315 invoked by uid 99); 9 Feb 2005 13:25:46 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy includes SPF record at spf.trusted-forwarder.org) Received: from smtp002.mail.ukl.yahoo.com (HELO smtp002.mail.ukl.yahoo.com) (217.12.11.33) by apache.org (qpsmtpd/0.28) with SMTP; Wed, 09 Feb 2005 05:25:45 -0800 Received: from unknown (HELO PORTSRAULT) (ksbrault@82.252.216.136 with login) by smtp002.mail.ukl.yahoo.com with SMTP; 9 Feb 2005 13:25:41 -0000 From: =?iso-8859-1?Q?St=E9phane_Rault?= To: "'Jakarta Commons Developers List'" Subject: RE : [VFS] Problem with Zip files Date: Wed, 9 Feb 2005 14:25:40 +0100 Message-ID: <000401c50eaa$d9bc9090$0300a8c0@PORTSRAULT> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.6626 Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 In-Reply-To: <420A0089.7090708@imapmail.org> X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hello Rob,=20 I tried :=20 zip://c:/temp/toto.zip zip:file://c:/temp/toto.zip But with the same exception : org.apache.commons.vfs.FileSystemException: Could not replicate "file://c:/temp/toto.zip" as it does not exist. at org.apache.commons.vfs.provider.AbstractFileSystem.replicateFile(Abstract= Fil eSystem.java:310) at org.apache.commons.vfs.provider.zip.ZipFileSystem.(ZipFileSystem.ja= va: 59) at org.apache.commons.vfs.provider.zip.ZipFileProvider.doCreateFileSystem(Zi= pFi leProvider.java:83) at org.apache.commons.vfs.provider.AbstractLayeredFileProvider.createFileSys= tem (AbstractLayeredFileProvider.java:77) at org.apache.commons.vfs.provider.AbstractLayeredFileProvider.findFile(Abst= rac tLayeredFileProvider.java:57) at org.apache.commons.vfs.impl.DefaultFileSystemManager.resolveFile(DefaultF= ile SystemManager.java:505) at org.apache.commons.vfs.impl.DefaultFileSystemManager.resolveFile(DefaultF= ile SystemManager.java:483) at org.apache.commons.vfs.impl.DefaultFileSystemManager.resolveFile(DefaultF= ile SystemManager.java:453) at test.FileTest.test6(FileTest.java:154) at test.FileTest.main(FileTest.java:37) I think this is a bug in zip protocol as it tried to wrap the file = protocol but can't manage to do it with a -non-existant file. Am I Wrong again :-) ? -----Message d'origine----- De : Rob Oxspring [mailto:roxspring@imapmail.org]=20 Envoy=E9 : mercredi 9 f=E9vrier 2005 13:23 =C0 : Jakarta Commons Developers List Objet : Re: [VFS] Problem with Zip files Hang on - you've switched protocols there - You asked about "file:" urls = not "zip:" urls! Looking at the vfs docs=20 (http://jakarta.apache.org/commons/sandbox/vfs/filesystems.html) it = would seem=20 that any of the following would refer to the file that you are after: file://C:/temp/toto.zip c:\temp\toto.zip c:/temp/toto.zip Note that the url version uses '/' symbols not '\' from your example. If you want to use the zip protocol then you need to wrap a file url, = and=20 usually refer to an entry within the zip: (I'm not sure what you get = without referring to an entry) zip:file://C:/temp/toto.zip Hope that helps, Rob St=E9phane Rault wrote: > Unfortunately, you're wrong : > I've put=20 >=20 > FileObject fileZip =3D = manager.resolveFile("zip:///c:\\temp\\toto.zip"); >=20 > And I got : >=20 > org.apache.commons.vfs.FileSystemException: Could not find file with=20 > URI "///c:\temp\toto.zip" because it is a relative path, and no base=20 > URI was provided. >=20 >=20 > -----Message d'origine----- > De : Rob Oxspring [mailto:roxspring@imapmail.org] > Envoy=E9 : mardi 8 f=E9vrier 2005 17:37 > =C0 : Jakarta Commons Developers List > Objet : Re: RE : [VFS] Problem with Zip files >=20 >=20 > I haven't used vfs (yet) but I'm pretty sure the the file url should=20 > have 3 > slashes: > "file:///c:/temp/toto.zip" > because urls reserve the spot between slash 2 and 3 for a host/port. >=20 > Rob >=20 > St=E9phane Rault wrote: >=20 >>XmlBeans doesn't matter in any way in my problem. Sorry for the >>confusion !! >> >>But my real problem with Zip file is still alive :-( >> >>Here is the stack trace of the exception catched : >> >>org.apache.commons.vfs.FileSystemException: Could not replicate >>"file://c:/temp/toto.zip" as it does not exist. >> at=20 >>org.apache.commons.vfs.provider.AbstractFileSystem.replicateFile(Abstr >>actFil >>eSystem.java:310) >> at >> >=20 > org.apache.commons.vfs.provider.zip.ZipFileSystem.(ZipFileSystem > .java: >=20 >>59) >> at >> >=20 > org.apache.commons.vfs.provider.zip.ZipFileProvider.doCreateFileSystem > (ZipFi >=20 >>leProvider.java:83) >> at >> >=20 > org.apache.commons.vfs.provider.AbstractLayeredFileProvider.createFile > System >=20 >>(AbstractLayeredFileProvider.java:77) >> at >> >=20 > org.apache.commons.vfs.provider.AbstractLayeredFileProvider.findFile(A > bstrac >=20 >>tLayeredFileProvider.java:57) >> at >> >=20 > org.apache.commons.vfs.impl.DefaultFileSystemManager.resolveFile(Defau > ltFile >=20 >>SystemManager.java:505) >> at >> >=20 > org.apache.commons.vfs.impl.DefaultFileSystemManager.resolveFile(Defau > ltFile >=20 >>SystemManager.java:483) >> at >> >=20 > org.apache.commons.vfs.impl.DefaultFileSystemManager.resolveFile(Defau > ltFile >=20 >>SystemManager.java:453) >> at test.FileTest.test6(FileTest.java:154) >> at test.FileTest.main(FileTest.java:37) >> >>In the API, resolveFile may worked even with file which doesn't exist >>(Am I wrong ?) >> >> >>-----Message d'origine----- >>De : St=E9phane Rault [mailto:ksbrault@yahoo.fr] >>Envoy=E9 : mardi 8 f=E9vrier 2005 08:43 >>=C0 : commons-dev@jakarta.apache.org >>Objet : [VFS] Problem with Zip files >> >> >>I've a problem accessing Zip files with VFS API. I'm using XmlBeans V2 >>(cause of a bug in V1) compiled the 10 jan 2005. >> >>Here is my sample code : >> >> try { >> =20 >> StandardFileSystemManager manager =3D new >>StandardFileSystemManager(); >> manager.setFilesCache(new SoftRefFilesCache()); >> manager.init(); >> =20 >> // toto.txt doesn't exist in the folder >> FileObject fileTxt =3D >=20 > manager.resolveFile("c:\\temp\\toto.txt"); >=20 >> System.out.println("File Text works !!"); >> =20 >> // toto.zip doesn't exist in the folder >> FileObject fileZip =3D >>manager.resolveFile("zip://c:\\temp\\toto.zip"); >> System.out.println("File Zip works !!"); >> =20 >> // The file and the folder don't exist >> FileObject fileInUnknownFolder =3D >>manager.resolveFile("c:\\notPresentFolder\\toto.txt"); >> System.out.println("File in unknown Folder works !!"); >> =20 >> } catch (Throwable t) { >> >> System.out.println("It doesn't work !!"); >> } >> >>And here is the output : >> >>File Text works !! >>It doesn't work !! >> >>Note that c:\\temp is an existing directory. >> >>Thanks in advance for your help... >> >>St=E9phane. --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org