commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From St├ęphane Rault <ksbra...@yahoo.fr>
Subject [VFS] Problem with Zip files
Date Tue, 08 Feb 2005 07:43:22 GMT
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: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message