protected String doInstallSharedLibrary(File tmpDirectory,SharedLibrary descriptor) throws DeploymentException{ String result=null; if(descriptor!=null){ try{ result=descriptor.getIdentification().getName(); File installationDir=environmentContext.createSharedLibraryDirectory(result); if(installationDir.exists()){ FileUtil.deleteFile(installationDir); } if(!tmpDirectory.renameTo(installationDir)){
protected String doInstallSharedLibrary(File tmpDirectory, SharedLibrary descriptor) throws DeploymentException{ String result = null; if (descriptor != null) { File installationDir = null; try { result = descriptor.getIdentification().getName(); File rootDir = environmentContext.createSharedLibraryDirectory(result); installationDir = FileVersionUtil.getNewVersionDirectory(rootDir); if (!tmpDirectory.renameTo(installationDir)) {
    protected String doInstallSharedLibrary(File tmpDirectory,SharedLibrary descriptor) throws DeploymentException{        String result=null;        if(descriptor!=null){            try{                result=descriptor.getIdentification().getName();                File installationDir=environmentContext.createSharedLibraryDirectory(result);                if(installationDir.exists()){                    FileUtil.deleteFile(installationDir);                }                if(!tmpDirectory.renameTo(installationDir)){                    throw new DeploymentException("Unable to rename " + tmpDirectory + " to " + installationDir);                }                if (log.isDebugEnabled()) {                    log.debug("Moved " + tmpDirectory + " to " + installationDir);                }                classLoaderService.addSharedLibrary(installationDir, descriptor);            }catch(IOException e){                log.error("Deployment of Shared Library failed",e);                // remove any files created for installation                environmentContext.removeComponentRootDirectory(descriptor.getIdentification().getName());                throw new DeploymentException(e);            }        }        return result;    }