@Override public void addDeployFile(String filename, String directory) { super.addDeployFile(filename, directory); String msg; File existingFile = new File(this.baseWorkingDirectory, filename); ProcessExecution pe = getUnzipExecution(existingFile, directory); if (pe != null) { ProcessExecutionResults results = this.systemInfo.executeProcess(pe); if (results.getError() != null) { msg = "Could not unbundle file [" + pe + "]: " + results; audit("deploy", BundleResourceDeploymentHistory.Status.FAILURE, msg); throw new RuntimeException(msg, results.getError()); } else if (results.getExitCode() == null || results.getExitCode().intValue() > 0) { msg = "Failed to unbundle file [" + pe + "]: " + results; audit("deploy", BundleResourceDeploymentHistory.Status.FAILURE, msg); throw new RuntimeException(msg); } else { msg = "extracted files from [" + existingFile + "] to [" + directory + "]"; } // existingFile.delete(); WOULD WE WANT TO REMOVE THE COMPRESSED FILE? audit("deploy", BundleResourceDeploymentHistory.Status.SUCCESS, msg); } else { // not a zipped format - just move the file to the directory as-is File newFile = new File(directory, filename); if (!existingFile.renameTo(newFile)) { msg = "Failed to move [" + existingFile + "] to [" + newFile + "]"; audit("deploy", BundleResourceDeploymentHistory.Status.FAILURE, msg); throw new RuntimeException(msg); } audit( "deploy", BundleResourceDeploymentHistory.Status.SUCCESS, "renamed [" + existingFile + "] to [" + newFile + "]"); } }