class ZipUtils {

	public static ZipResult createZipAndCheck(File srcFolder, File destFolder, String zipName, boolean compress) {
		if(zipName==null) {
			zipName = srcFolder.getName();
		}
		File newZipFile = createZip(srcFolder, destFolder, zipName, compress);
		log.info("[createZipAndCheck] Zip file created: " + zipName);
		ZipResult zipResult = new ZipResult();
		try {
			byte[] digest = Checksums.md5(newZipFile);
			zipResult.setZipFile(newZipFile);
			zipResult.setChecksum(new Checksum("MD5", Arrays.toString(digest)));
			log.info("[createZipAndCheck] Checksum (MD5) created: " + zipResult.getChecksum()); 
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
		return zipResult;
	}

}