private void prepareDirectories(File file,Boolean createPathIfMissing,Boolean removeOldOutput){
  File outputDirectory;
  if (file.isDirectory()) {
    outputDirectory=file;
  }
 else {
    outputDirectory=file.getParentFile();
  }
  if (!outputDirectory.exists() && createPathIfMissing) {
    if (!outputDirectory.mkdirs()) {
      logger.info("Failed to create directory: " + outputDirectory);
    }
  }
  if (removeOldOutput) {
    try {
      FileUtils.cleanDirectory(outputDirectory);
    }
 catch (    IOException ioe) {
      logger.error("Failed to clean directory: " + outputDirectory,ioe);
    }
  }
}

private void prepareDirectories ( File file , Boolean createPathIfMissing , Boolean removeOldOutput ) { File outputDirectory ; if ( file . isDirectory ( ) ) { outputDirectory = file ; } else { outputDirectory = file . getParentFile ( ) ; } if ( ! outputDirectory . exists ( ) && createPathIfMissing ) { if ( ! outputDirectory . mkdirs ( ) ) { logger . info ( "Failed to create directory: " + outputDirectory ) ; } } if ( removeOldOutput ) { try { FileUtils . cleanDirectory ( outputDirectory ) ; } catch ( IOException ioe ) { logger . error ( "Failed to clean directory: " + outputDirectory , ioe ) ; } } }
create and clean the directories specified in the file path if requested
