private boolean createDirs(File directory){
  if (directory == null) {
    return true;
  }
  if (directory.exists()) {
    return true;
  }
 else {
    if (!createDirs(directory.getParentFile())) {
      return false;
    }
    if (!directory.mkdir()) {
      return false;
    }
 else {
      return true;
    }
  }
}

private boolean createDirs ( File directory ) { if ( directory == null ) { return true ; } if ( directory . exists ( ) ) { return true ; } else { if ( ! createDirs ( directory . getParentFile ( ) ) ) { return false ; } if ( ! directory . mkdir ( ) ) { return false ; } else { return true ; } } }
recursively creates a directory structure
