commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Fortner" <phidia...@gmail.com>
Subject Re: VFS how to read gzipped content from tar file
Date Tue, 06 Nov 2007 23:42:14 GMT
You mentioned that you wanted to look into a tarball (gzipped tar file), but
the URL you gave was only for a tar file.  Something like this should work:

gz:tar:file:///extra/data/tryVfs/archive.tar.gz!/myfile.txt

Hope this helps,

Mark

On 10/31/07, Ken Tanaka < Ken.Tanaka@noaa.gov> wrote:
>
> 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
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message