public static void assertTarContents( Set<String> required, Set<String> banned, File assembly )
throws IOException
{
assertTrue( "Assembly archive missing: " + assembly, assembly.isFile() );
GZipTarFile tarFile = null;
try
{
tarFile = new GZipTarFile( assembly );
LinkedHashSet<String> pathSet = new LinkedHashSet<String>();
for ( @SuppressWarnings( "unchecked" )
Enumeration<TarEntry> enumeration = tarFile.getEntries(); enumeration.hasMoreElements(); )
{
pathSet.add( enumeration.nextElement().getName() );
}
assertArchiveContents( required, banned, assembly.getAbsolutePath(), pathSet );
}
finally
{
if ( tarFile != null )
{
tarFile.close();
}
}
}