StreamedContent primefaces 7
public StreamedContent getServicesInZip() {
logger.info("getServicesInZip invoked {}", getUser());
try {
InputStream stream = new FileInputStream(BeanUtil.getSfContext().getServiceMarshalManager().packInZip(exportServices()));
return new DefaultStreamedContent(stream, "application/zip", "Services.zip");
} catch (FileNotFoundException e) {
logger.error(e.getMessage(), e);
}
return null;
}