I want to Zip a set of files given the location of the set of files.
Send that Zip file to the below-mentioned method
private StreamingOutput buildStreamingOutput(final File pdfFile, final boolean isGeneratedPdf) {
return new StreamingOutput() {
@Override
public void write(OutputStream output) throws IOException, WebApplicationException {
java.nio.file.Path path = Paths.get(pdfFile.getAbsolutePath());
byte[] data = CryptoUtil.decryptAsByteArray(path);
output.write(data);
output.flush();
output.close();
if (isGeneratedPdf) {
pdfFile.delete();
}
}
};
}
Is it possible to zip files and send that Zip file as file(File.class)