java/automation/src/main/java/be/bosa/dt/best/automation/services/ZipService.java
/**
	 * Add a file to zip
	 * 
	 * @param pin input file
	 * @param zos output stream
	 * @throws IOException
	 */
Add a file to zip

@param pin input file
@param zos output stream
@throws IOException
Add a file to zip @param pin input file @param zos output stream @throws IOException
private void zip(Path pin, ZipOutputStream zos) throws IOException {
		ZipEntry zipEntry = new ZipEntry(pin.getFileName().toString());
		try(InputStream fis = Files.newInputStream(pin)) {
			LOG.infof("Zipping %s", pin);
			zos.putNextEntry(zipEntry);
			byte[] buffer = new byte[32*1024];
			int len;
			while ((len = fis.read(buffer)) >= 0) {
				zos.write(buffer, 0, len);
			}
		}
	}
private void zip ( Path pin , ZipOutputStream zos ) throws IOException { ZipEntry zipEntry = new ZipEntry ( pin . getFileName ( ) . toString ( ) ) ; try ( InputStream fis = Files . newInputStream ( pin ) ) { LOG . infof ( "Zipping %s" , pin ) ; zos . putNextEntry ( zipEntry ) ; byte [ ] buffer = new byte [ 32 * 1024 ] ; int len ; while ( ( len = fis . read ( buffer ) ) >= 0 ) { zos . write ( buffer , 0 , len ) ; } } }
Add a file to zip
Add a file to zip