commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mario Ivankovits <ma...@ops.co.at>
Subject Re: [VFS] example code contributed to wiki
Date Fri, 09 Nov 2007 07:13:34 GMT
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


Mime
View raw message