Example
protected void doGet(HttpServletRequest arg0, HttpServletResponse arg1) throws IOException {
FileOutputStream fOS = FileUtility.getFileOutputStream(FileUtility.getFileName());
ZipOutputStream zOS = new ZipOutputStream(fOS);
zOS.putNextEntry(new ZipEntry("foo"));
zOS.putNextEntry(new ZipEntry("foo2"));
zOS.putNextEntry(new ZipEntry("foo3"));
zOS.close();
fOS.close();
}
Solution
If artifacts need to be zipped, zip them before the application starts or in an offline job.