public static void zipExtractSingleFile ( File zipFile , File destination , String pathInZip ) throws IOException { try ( ZipFile zf = new ZipFile ( zipFile ) ; InputStream is = new BufferedInputStream ( zf . getInputStream ( zf . getEntry ( pathInZip ) ) ) ; OutputStream os = new BufferedOutputStream ( new FileOutputStream ( destination ) ) ) { IOUtils . copy ( is , os ) ; } }
Extract a single file from a . zip file . Does not support directories