String name = LuceneUtils.getNameForDirectory(index);
DataStoreDirectory directory = new DataStoreDirectory(name);
IndexTool tool = new IndexTool(directory);
resp.setContentType("application/zip");
ServletOutputStream out = resp.getOutputStream();
try {
tool.exportZip(out);
} finally {
out.close();
}
}