You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Ken Tanaka <Ke...@noaa.gov> on 2007/11/08 23:50:40 UTC
[VFS] example code contributed to wiki
I placed some example code that uses the VFS API into the apache.org
wiki VfsCookbook. The example demonstrates the retrieving of files from
a tar file, decompressing any content that is gzipped as well. While
it's still fresh in my mind, it would be nice if anyone interested in
VFS documentation could take a look and make suggestions (or make
corrections directly, it IS a wiki after all).
http://wiki.apache.org/jakarta-commons/ExtractAndDecompressGzipFiles
-Ken
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org
Re: [VFS] example code contributed to wiki
Posted by Ken Tanaka <Ke...@noaa.gov>.
Thanks, I'll update the page
-Ken
Mario Ivankovits wrote:
> Hi!
>
>> http://wiki.apache.org/jakarta-commons/ExtractAndDecompressGzipFiles
>>
> Good work! I am happy with every contribution which makes it easier for
> others to jump into VFS.
>
> One thing, to make your example even more general.
> Instead of:
> if (extractFile.getName().getExtension().equals("gz"))
>
> you can do something like:
>
> if (manager.canCreateFileSystem(extractFile))
> {
> FileObject innerFile = manager.createFileSystem(extractFile);
> }
>
> That way, if VFS is aware of the type of the file, it automatically
> "drill-down" into the file.
>
> Ciao,
> Mario
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org
Re: [VFS] example code contributed to wiki
Posted by Mario Ivankovits <ma...@ops.co.at>.
Hi!
> http://wiki.apache.org/jakarta-commons/ExtractAndDecompressGzipFiles
Good work! I am happy with every contribution which makes it easier for
others to jump into VFS.
One thing, to make your example even more general.
Instead of:
if (extractFile.getName().getExtension().equals("gz"))
you can do something like:
if (manager.canCreateFileSystem(extractFile))
{
FileObject innerFile = manager.createFileSystem(extractFile);
}
That way, if VFS is aware of the type of the file, it automatically
"drill-down" into the file.
Ciao,
Mario
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org