commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ken Tanaka <Ken.Tan...@noaa.gov>
Subject Re: VFS how to read gzipped content from tar file
Date Wed, 31 Oct 2007 21:35:24 GMT
Thanks for the suggestion, but I'm getting a different error when I try 
that:
org.apache.commons.vfs.FileSystemException: Could not resolve file 
"gz:tar:file:///extra/data/tryVfs/archive.tar!/!/".       
        at 
org.apache.commons.vfs.provider.AbstractFileSystem.resolveFile(AbstractFileSystem.java:301)
        at 
org.apache.commons.vfs.provider.AbstractFileSystem.resolveFile(AbstractFileSystem.java:267)
        at 
org.apache.commons.vfs.provider.AbstractFileSystem.getRoot(AbstractFileSystem.java:242)
        at 
org.apache.commons.vfs.provider.AbstractLayeredFileProvider.createFileSystem(AbstractLayeredFileProvider.java:82)
        at 
org.apache.commons.vfs.provider.AbstractLayeredFileProvider.findFile(AbstractLayeredFileProvider.java:59)
        at 
org.apache.commons.vfs.impl.DefaultFileSystemManager.resolveFile(DefaultFileSystemManager.java:641)
        at 
org.apache.commons.vfs.impl.DefaultFileSystemManager.resolveFile(DefaultFileSystemManager.java:602)
        at 
org.apache.commons.vfs.impl.DefaultFileSystemManager.resolveFile(DefaultFileSystemManager.java:570)
        at gov.noaa.eds.tryVfs.App.main(App.java:51)
Caused by: java.lang.StringIndexOutOfBoundsException: String index out 
of range: -1
        at java.lang.String.substring(String.java:1768)
        at 
org.apache.commons.vfs.provider.compressed.CompressedFileFileObject.<init>(CompressedFileFileObject.java:48)
        at 
org.apache.commons.vfs.provider.gzip.GzipFileObject.<init>(GzipFileObject.java:39)
        at 
org.apache.commons.vfs.provider.gzip.GzipFileSystem.createFile(GzipFileSystem.java:42)
        at 
org.apache.commons.vfs.provider.AbstractFileSystem.resolveFile(AbstractFileSystem.java:296)
        ... 8 more


Here is the exact code corresponding to the above error:
            FileObject contentFile = fsManager.resolveFile(
                    
"gz:tar:///extra/data/tryVfs/archive.tar!/tardir/content.txt.gz"
                );

Philippe Poulard wrote:
> Hi Ken,
>
> Ken Tanaka a écrit :
>>
>>    FileObject gzTarFile = 
>> fsManager.resolveFile("tar:gz:/archive.tar!/tardir/content.txt.gz");
>
> try this :
>
> fsManager.resolveFile("gz:tar:/archive.tar!/tardir/content.txt.gz");
>

-- 
= Enterprise Data Services Division ===============
| CIRES, National Geophysical Data Center / NOAA  |
| 303-497-6221                                    |
= Ken.Tanaka@noaa.gov =============================


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


Mime
View raw message