question: public void copyZip ( final String srcFile , final String destFile ) throws Exception { loadDefaultExcludePattern ( getRootFolderInZip ( srcFile ) ) ; final ZipFile zipSrc = new ZipFile ( srcFile ) ; final ZipOutputStream out = new ZipOutputStream ( new FileOutputStream ( destFile ) ) ; try { final Enumeration < ? extends ZipEntry > entries = zipSrc . entries ( ) ; while ( entries . hasMoreElements ( ) ) { final ZipEntry entry = entries . nextElement ( ) ; if ( ! isExcluded ( LocalPath . combine ( srcFile , entry . getName ( ) ) , false , srcFile ) ) { final ZipEntry newEntry = new ZipEntry ( entry . getName ( ) ) ; out . putNextEntry ( newEntry ) ; final BufferedInputStream in = new BufferedInputStream ( zipSrc . getInputStream ( entry ) ) ; int len ; final byte [ ] buf = new byte [ 65536 ] ; while ( ( len = in . read ( buf ) ) > 0 ) { out . write ( buf , 0 , len ) ; } out . closeEntry ( ) ; in . close ( ) ; } } out . finish ( ) ; } catch ( final IOException e ) { errorMsg = Messages . getString ( "CreateUploadZipCommand.CopyArchiveErrorMessageFormat" ) ; log . error ( "Exceptions when copying exising archive " , e ) ; throw e ; } finally { out . close ( ) ; zipSrc . close ( ) ; } }
target:  Copy zip file and remove ignored files