protected File unzipDistribution(File dir,File zip){
  File exploded=new File(dir,BOOTSTRAP_DISTRIBUTION + "-exploded");
  if (exploded.exists()) {
    if (forceBootstrapUpdate() == false)     return exploded;
 else     delete(exploded);
  }
  try {
    final ZipFile zipFile=new ZipFile(zip);
    try {
      final Enumeration<? extends ZipEntry> entries=zipFile.entries();
      while (entries.hasMoreElements()) {
        final ZipEntry ze=entries.nextElement();
        final File file=new File(exploded,ze.getName());
        if (ze.isDirectory()) {
          if (FileUtil.mkdirs(file) == false)           throw new IllegalArgumentException("Cannot create dir: " + file);
        }
 else {
          final FileOutputStream fos=new FileOutputStream(file);
          copyStream(zipFile.getInputStream(ze),fos);
        }
      }
    }
  finally {
      zipFile.close();
    }
  }
 catch (  IOException e) {
    throw new IllegalArgumentException(e);
  }
  return exploded;
}

protected File unzipDistribution ( File dir , File zip ) { File exploded = new File ( dir , BOOTSTRAP_DISTRIBUTION + "-exploded" ) ; if ( exploded . exists ( ) ) { if ( forceBootstrapUpdate ( ) == false ) return exploded ; else delete ( exploded ) ; } try { final ZipFile zipFile = new ZipFile ( zip ) ; try { final Enumeration < ? extends ZipEntry > entries = zipFile . entries ( ) ; while ( entries . hasMoreElements ( ) ) { final ZipEntry ze = entries . nextElement ( ) ; final File file = new File ( exploded , ze . getName ( ) ) ; if ( ze . isDirectory ( ) ) { if ( FileUtil . mkdirs ( file ) == false ) throw new IllegalArgumentException ( "Cannot create dir: " + file ) ; } else { final FileOutputStream fos = new FileOutputStream ( file ) ; copyStream ( zipFile . getInputStream ( ze ) , fos ) ; } } } finally { zipFile . close ( ) ; } } catch ( IOException e ) { throw new IllegalArgumentException ( e ) ; } return exploded ; }
unzip bootstrap distrubution if not already present .
