java/automation/src/main/java/be/bosa/dt/best/automation/services/ZipService.java
/**
	 * (Recursively) unzip a zip file into a directory
	 * 
	 * @param pin input file
	 * @param pout output directory
	 * @throws IOException
	 */
(Recursively) unzip a zip file into a directory

@param pin input file
@param pout output directory
@throws IOException
( Recursively ) unzip a zip file into a directory @param pin input file @param pout output directory @throws IOException
private void unzip(Path pin, Path pout) throws IOException {
		try (ZipFile zip = new ZipFile(pin.toFile())) {
			for (ZipEntry f: zip.stream().toArray(ZipEntry[]::new)) {
				String name = f.getName();
				Path p = Paths.get(pout.toString(), name);
				LOG.infof("Unzipping %s", p);
				try (InputStream is = zip.getInputStream(f)) {
					Files.copy(is, p);
					if (name.endsWith("zip")) { 
						unzip(p, pout);
					}
				}
			}
		}
	}
private void unzip ( Path pin , Path pout ) throws IOException { try ( ZipFile zip = new ZipFile ( pin . toFile ( ) ) ) { for ( ZipEntry f : zip . stream ( ) . toArray ( ZipEntry [ ] :: new ) ) { String name = f . getName ( ) ; Path p = Paths . get ( pout . toString ( ) , name ) ; LOG . infof ( "Unzipping %s" , p ) ; try ( InputStream is = zip . getInputStream ( f ) ) { Files . copy ( is , p ) ; if ( name . endsWith ( "zip" ) ) { unzip ( p , pout ) ; } } } } }
(Recursively) unzip a zip file into a directory
( Recursively ) unzip a zip file into a directory
// zip within zip
