@SuppressWarnings("deprecation") public File explodeSUIntoSAInstallDirectory(String serviceUnitId, URL suZipLocation, String serviceAssemblyId) throws IOException { File installationRoot = this.createSUInstallDirectory(serviceUnitId, serviceAssemblyId); try { File zipArchive = new File(URLDecoder.decode(suZipLocation.getPath())); ZipUtil.unzipArchive(zipArchive, installationRoot); } catch (IOException e) { try { FileUtils.forceDelete(installationRoot); } catch (IOException e1) { // Nothing to do, just log this.log.warning("Failed to clean a failed installation", e); } throw e; } return installationRoot; }
@SuppressWarnings("deprecation") private File explodeEntityPackage(URL archiveUrl) throws PetalsException { File zipFile = new File(URLDecoder.decode(archiveUrl.getPath())); File destFile = new File(this.getWorkDirectory(), zipFile.getName() + "-" + uniqueIdSuffix.incrementAndGet()); try { destFile.mkdir(); ZipUtil.unzipArchive(zipFile, destFile); } catch (IOException e) { try { FileUtils.forceDelete(destFile); } catch (IOException e1) { // Nothing to do, just log this.log.warning("Failed to delete the temporary directory '" + destFile.getAbsolutePath() + "'", e); } throw new PetalsException(e); } return destFile; }