[VFS] example code contributed to wiki

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[VFS] example code contributed to wiki

Ken Tanaka
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [VFS] example code contributed to wiki

Mario Ivankovits
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [VFS] example code contributed to wiki

Ken Tanaka
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: [hidden email]
For additional commands, e-mail: [hidden email]