You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Stéphane Rault <ks...@yahoo.fr> on 2005/02/08 08:41:27 UTC

RE : [VFS] Problem with Zip files

Oh..my godness...

I think I've posted in the wrong mailing list.. 

I wish to apologized for the noise...

Information : My code is from the Apache Jakarta Common project. It's called
VFS (Virtual File System) and offer an API to access a file with differents
protocols (file:// ftp:// zip:// jar:// http:// sftp:// etc.)

And once again, excuse me....and thanks for your response !

-----Message d'origine-----
De : Jacob Danner [mailto:jacobd@bea.com] 
Envoyé : lundi 7 février 2005 20:13
À : user@xmlbeans.apache.org
Objet : RE: [VFS] Problem with Zip files


I can't tell from your code how XmlBeans relates to the problem. 
But I'll give your problem a shot. It looks like it may be 1 of 2 things.

1) You are using a non-standard url in the line:
manager.resolveFile("zip://c:\\temp\\toto.zip"); Take a peek at
http://archive.ncsa.uiuc.edu/SDG/Software/Mosaic/Demo/url-primer.html
for more info.

2) manager.resolveFile throws an exception when it can't resolve the file.
This may be correct behavior for the API, but I haven't ever worked with
those APIs so I'm not certain. If this is the case though your sample is
failing for a valid reason.

-Jacobd

-----Original Message-----
From: Stéphane Rault [mailto:ksbrault@yahoo.fr] 
Sent: Monday, February 07, 2005 2:15 AM
To: user@xmlbeans.apache.org
Subject: [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 {
            
            StandardFileSystemManager manager = new
StandardFileSystemManager();
            manager.setFilesCache(new SoftRefFilesCache());
            manager.init();
            
            // toto.txt doesn't exist in the folder
            FileObject fileTxt = manager.resolveFile("c:\\temp\\toto.txt");
            System.out.println("File Text works !!");
            
            // toto.zip doesn't exist in the folder
            FileObject fileZip =
manager.resolveFile("zip://c:\\temp\\toto.zip");
            System.out.println("File Zip works !!");
            
            // The file and the folder don't exist
            FileObject fileInUnknownFolder =
manager.resolveFile("c:\\notPresentFolder\\toto.txt");
            System.out.println("File in unknown Folder works !!");
            
        } 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éphane.




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org