public void createDirectory(File dir){
  if (!dir.exists()) {
    log.info("Creating directory: {}",dir);
    if (!dir.mkdirs()) {
      log.error("Failed to create directory: {}",dir);
    }
  }
}

public void createDirectory ( File dir ) { if ( ! dir . exists ( ) ) { log . info ( "Creating directory: {}" , dir ) ; if ( ! dir . mkdirs ( ) ) { log . error ( "Failed to create directory: {}" , dir ) ; } } }
create a directory if required . any parent directories will also be created .
