code: public static void createFile(File file) throws Exception {
      File dir = new File(file.getAbsolutePath().replace(File.separator + file.getName(), ""));
      if(!dir.exists()) {
        if(!dir.mkdirs()) {
          throw new Exception("Can't create dirs "+dir);
        }
      }
      file.createNewFile();
    }
docs: TODO re-do as non-static