This is actually a little more significant than the title may indicate. This initially was just supposed to be "make things work with *.tar.gz files. Exploring that quickly revealed that doing the work of essentially arbitrary content listing was not terribly different, so there you go.
The crux of this change is to add some extension methods to make listing the contents of archives simple and keep icky details in the helper methods. These extension methods work when listing contents of nested archives as well.
So, if you have foo.zip that contains bar.tar.gz that has a subdirectory containing baz.tar which in turn contains gnarly.zip in a subdirectory, you can start from foo.zip and list contents within the deeply nested zip archive.
Recursive listing of contents is supported as well, and 'containers' (directories and nested archives) may be eliminated from the returned results. Thus, you can easily recursively list the contents of (somewhat) arbitrary 'archive-like' files that only contain files, for example.
Tests cover the new methods, and test assets are included.
If / when other (compressed) (archive) formats are added, updating the extension methods may (or may not) be necessary.
This is actually a little more significant than the title may indicate. This initially was just supposed to be "make things work with
*.tar.gz
files. Exploring that quickly revealed that doing the work of essentially arbitrary content listing was not terribly different, so there you go.The crux of this change is to add some extension methods to make listing the contents of archives simple and keep icky details in the helper methods. These extension methods work when listing contents of nested archives as well.
So, if you have
foo.zip
that containsbar.tar.gz
that has a subdirectory containingbaz.tar
which in turn containsgnarly.zip
in a subdirectory, you can start fromfoo.zip
and list contents within the deeply nested zip archive.Recursive listing of contents is supported as well, and 'containers' (directories and nested archives) may be eliminated from the returned results. Thus, you can easily recursively list the contents of (somewhat) arbitrary 'archive-like' files that only contain files, for example.
Tests cover the new methods, and test assets are included.
If / when other (compressed) (archive) formats are added, updating the extension methods may (or may not) be necessary.