CompressedApplicationInputStream implements AutoCloseable { public static CompressedApplicationInputStream createFromCompressedStream(InputStream is, String contentType) { try { ArchiveInputStream ais = getArchiveInputStream(is, contentType); return createFromCompressedStream(ais); } catch (IOException e) { throw new InternalServerException("Unable to create compressed application stream", e); } } private  CompressedApplicationInputStream(ArchiveInputStream ais); static CompressedApplicationInputStream createFromCompressedStream(InputStream is, String contentType); void close(); File decompress(File dir);  }
@Test(expected = IOException.class) public void require_that_invalid_application_returns_error_when_unpacked() throws IOException { File app = new File("src/test/resources/deploy/validapp/services.xml"); CompressedApplicationInputStream.createFromCompressedStream( new TarArchiveInputStream(new GZIPInputStream(new FileInputStream(app)))); }