code: public static File createDir(String dir) {
          // create outdir
          File directory = null;
          if(dir != null) {
              directory = new File(dir);
              if(!(directory.exists() || directory.mkdir())) {
                  Utils.croak("Can't find or create directory " + dir);
              }
          }
          return directory;
      }
docs: Utility function that creates directory.
  
  @param dir Directory path
  @return File object of directory.