private void backupDeployedJars(RestoreScript restoreScript,File backupDir) throws IOException {
  JarDeployer deployer=null;
  try {
    deployer=new JarDeployer();
    deployer.suspendAll();
    List<JarClassLoader> jarList=deployer.findJarClassLoaders();
    if (!jarList.isEmpty()) {
      File userBackupDir=new File(backupDir,USER_FILES);
      if (!userBackupDir.exists()) {
        userBackupDir.mkdir();
      }
      for (      JarClassLoader loader : jarList) {
        File source=new File(loader.getFileCanonicalPath());
        File dest=new File(userBackupDir,source.getName());
        FileUtil.copy(source,dest);
        restoreScript.addFile(source,dest);
      }
    }
  }
  finally {
    if (null != deployer) {
      deployer.resumeAll();
    }
  }
}

private void backupDeployedJars ( RestoreScript restoreScript , File backupDir ) throws IOException { JarDeployer deployer = null ; try { deployer = new JarDeployer ( ) ; deployer . suspendAll ( ) ; List < JarClassLoader > jarList = deployer . findJarClassLoaders ( ) ; if ( ! jarList . isEmpty ( ) ) { File userBackupDir = new File ( backupDir , USER_FILES ) ; if ( ! userBackupDir . exists ( ) ) { userBackupDir . mkdir ( ) ; } for ( JarClassLoader loader : jarList ) { File source = new File ( loader . getFileCanonicalPath ( ) ) ; File dest = new File ( userBackupDir , source . getName ( ) ) ; FileUtil . copy ( source , dest ) ; restoreScript . addFile ( source , dest ) ; } } } finally { if ( null != deployer ) { deployer . resumeAll ( ) ; } } }
copies user deployed jars to the backup directory .
