public void downloadAndInstall ( ) throws IOException { installDir . mkdirs ( ) ; File tempFile = File . createTempFile ( "pax-exam" , ".zip" ) ; FileOutputStream os = null ; LOG . info ( "downloading {} to {}" , zipUrl , tempFile ) ; try { os = new FileOutputStream ( tempFile ) ; StreamUtils . copyStream ( zipUrl . openStream ( ) , os , true ) ; LOG . info ( "unzipping into {}" , installDir ) ; ZipExploder exploder = new ZipExploder ( ) ; exploder . processFile ( tempFile , installDir ) ; } finally { tempFile . delete ( ) ; } }
Download and unpacks the archive .