class FullScanDataToZipOutputSupport {

	public void writeScanData(FullScanData data, OutputStream outputStream) throws IOException{
		List<String> fileNamesAlreadyUsed = new ArrayList<>();

		try (ZipOutputStream zippedOut = new ZipOutputStream(outputStream)) {
	    	for (ProjectScanLog log: data.allScanLogs) {
	    		writeStringAsZipFileEntry(zippedOut, log.toString(), "log_"+log.getUUID(),fileNamesAlreadyUsed);
	    	}
	    	for (ScanData sd: data.allScanData) {
	    		writeStringAsZipFileEntry(zippedOut, sd.result, sd.productId,fileNamesAlreadyUsed);
	    		String metaData = sd.metaData;
	    		if (metaData==null) {
	    		    metaData="{ \"message\" : \"no meta data available\" }";
	    		}
	    		writeStringAsZipFileEntry(zippedOut, metaData, "metadata_"+sd.productId,fileNamesAlreadyUsed);
	    	}
	    	zippedOut.closeEntry();
	    	zippedOut.finish();
	    }
	}

}