private static void zipDir ( final File srcDir , final FileFilter filter , final String destPath , final ZipOutputStream out ) throws IOException { final File [ ] files = listFiles ( srcDir , filter ) ; for ( int i = 0 ; i < files . length ; i ++ ) { if ( files [ i ] . isDirectory ( ) ) { zipDir ( files [ i ] , filter , concatPathAndFilename ( destPath , files [ i ] . getName ( ) , File . separator ) , out ) ; } else { zipFile ( files [ i ] , destPath , out ) ; } } }
Add a directory to a ZIP output stream .