protected String deploy(File tmpDir, ServiceAssembly sa) throws Exception { String result = ""; String assemblyName = sa.getIdentification().getName(); File oldSaDirectory = environmentContext.getSARootDirectory(assemblyName); FileUtil.deleteFile(oldSaDirectory); File saDirectory = environmentContext.createSARootDirectory(assemblyName); log.info(assemblyName + " Moving " + tmpDir.getAbsolutePath() + " to " + saDirectory.getAbsolutePath());  if (tmpDir.renameTo(saDirectory)) {  ServiceUnit[] sus = sa.getServiceUnits(); if (sus != null) { for (int i = 0;i < sus.length;i++) { if (i > 0) { result += " ; "; } result += deployServiceUnit(saDirectory, sus[i]); }
public String deploy(String saZipURL) throws Exception { try { String result = null; File tmpDir = AutoDeploymentService.unpackLocation(environmentContext.getTmpDir(), saZipURL); Descriptor root = AutoDeploymentService.buildDescriptor(tmpDir); ServiceAssembly sa = root.getServiceAssembly(); if (sa != null) { result = deploy(tmpDir, sa);
    protected String deploy(File tmpDir, ServiceAssembly sa) throws Exception {        String result = "";        String assemblyName = sa.getIdentification().getName();        File oldSaDirectory = environmentContext.getSARootDirectory(assemblyName);        FileUtil.deleteFile(oldSaDirectory);        File saDirectory = environmentContext.createSARootDirectory(assemblyName);        log.info(assemblyName + " Moving " + tmpDir.getAbsolutePath() + " to " + saDirectory.getAbsolutePath());                if (tmpDir.renameTo(saDirectory)) {            // move the assembly to a well-named holding area            ServiceUnit[] sus = sa.getServiceUnits();            if (sus != null) {                for (int i = 0;i < sus.length;i++) {                    if (i > 0) {                        result += " ; ";                    }                    result += deployServiceUnit(saDirectory, sus[i]);                }            }            buildConnections(sa);            container.getRegistry().registerServiceAssembly(sa);        }        else {            log.error("Failed to rename " + tmpDir + " TO " + saDirectory);        }        return result;    }