new ZipOutputStream(response.getOutputStream());
// add resources
Vector beans = Resources.getResourceXmlBeans(this);
for (int i = 0; i < beans.size(); i++) {
ResourceXmlBean bean = (ResourceXmlBean) beans.get(i);
File root =
new File(
getServletContext().getRealPath("/"),
resourcesPath);
File dir = new File(root, bean.getDirectory());
File[] files = dir.listFiles();
for (int k = 0; k < files.length; k++) {
File file = files[k];
if (file.isFile()) {
InputStream in = new FileInputStream(file);
ZipEntry ze =
new ZipEntry(
"resources/"
+ bean.getId()
+ "/"
+ file.getName());
zip.putNextEntry(ze);
// Transfer bytes from the file to the ZIP file