public void copyBackupSet(File sourceDir,File destDir) throws IOException {
  log.debug("copying backup set from: {} to: {}",sourceDir,destDir);
  log.info("Saving copy of operations files to: {}",destDir);
  if (!sourceDir.exists()) {
    throw new IOException("Backup Set source directory: " + sourceDir.getAbsolutePath() + " does not exist");
  }
  int sourceCount=getSourceFileCount(sourceDir);
  if (sourceCount == 0) {
    log.debug("No source files found in {} so skipping copy.",sourceDir.getAbsolutePath());
    return;
  }
  if (sourceCount != _backupSetFileNames.length) {
    log.warn("Only {} file(s) found in directory {}",sourceCount,sourceDir.getAbsolutePath());
  }
  if (!destDir.exists()) {
    boolean result=destDir.mkdirs();
    if (!result) {
      throw new IOException(destDir.getAbsolutePath() + " (Could not create all or part of the Backup Set path)");
    }
  }
  for (  String name : _backupSetFileNames) {
    log.debug("copying file: {}",name);
    File src=new File(sourceDir,name);
    if (src.exists()) {
      File dst=new File(destDir,name);
      FileHelper.copy(src.getAbsolutePath(),dst.getAbsolutePath(),true);
    }
 else {
      log.debug("Source file: {} does not exist, and is not copied.",src.getAbsolutePath());
    }
  }
  if (testException != null) {
    testException.fillInStackTrace();
    throw testException;
  }
}

public void copyBackupSet ( File sourceDir , File destDir ) throws IOException { log . debug ( "copying backup set from: {} to: {}" , sourceDir , destDir ) ; log . info ( "Saving copy of operations files to: {}" , destDir ) ; if ( ! sourceDir . exists ( ) ) { throw new IOException ( "Backup Set source directory: " + sourceDir . getAbsolutePath ( ) + " does not exist" ) ; } int sourceCount = getSourceFileCount ( sourceDir ) ; if ( sourceCount == 0 ) { log . debug ( "No source files found in {} so skipping copy." , sourceDir . getAbsolutePath ( ) ) ; return ; } if ( sourceCount != _backupSetFileNames . length ) { log . warn ( "Only {} file(s) found in directory {}" , sourceCount , sourceDir . getAbsolutePath ( ) ) ; } if ( ! destDir . exists ( ) ) { boolean result = destDir . mkdirs ( ) ; if ( ! result ) { throw new IOException ( destDir . getAbsolutePath ( ) + " (Could not create all or part of the Backup Set path)" ) ; } } for ( String name : _backupSetFileNames ) { log . debug ( "copying file: {}" , name ) ; File src = new File ( sourceDir , name ) ; if ( src . exists ( ) ) { File dst = new File ( destDir , name ) ; FileHelper . copy ( src . getAbsolutePath ( ) , dst . getAbsolutePath ( ) , true ) ; } else { log . debug ( "Source file: {} does not exist, and is not copied." , src . getAbsolutePath ( ) ) ; } } if ( testException != null ) { testException . fillInStackTrace ( ) ; throw testException ; } }
copies a complete set of operations files from one directory to another directory . usually used to copy to or from a backup location . creates the destination directory if it does not exist . only copies files that are included in the list of operations files .
