}
}
protected void deployFile(ProcessEngine processEngine, File processFile) {
RepositoryService repositoryService = processEngine.getRepositoryService();
NewDeployment deployment = repositoryService.createDeployment();
deployment.setName(processFile.getName());
deployment.setTimestamp(System.currentTimeMillis());
if (processFile.getName().endsWith(".xml")) {
log("deploying process file "+processFile.getName());
deployment.addResourceFromFile(processFile);
} else if (processFile.getName().endsWith("ar")) {
log("deploying business archive "+processFile.getName());
try {
FileInputStream fileInputStream = new FileInputStream(processFile);
ZipInputStream zipInputStream = new ZipInputStream(fileInputStream);
deployment.addResourcesFromZipInputStream(zipInputStream);
} catch (Exception e) {
throw new BuildException("couldn't read business archive "+processFile, e);
}
} else {
throw new BuildException("unsupported extension: "+processFile+" Only .xml files and .*ar archives are supported");
}
deployment.deploy();
}