code: public static File newFile(String path, String content) throws FileAlreadyExistsException {
          File file = new File(path);
          boolean created;
          try {
              created = file.createNewFile();
          } catch (IOException e) {
              throw new RuntimeException(e);
          }
          if (!created) {
              throw new FileAlreadyExistsException("Failed to create'" + path + "'. May be file already exists!");
          }
          try (BufferedWriter writer = new BufferedWriter(new FileWriter(file))) {
              writer.write(content);
          } catch (IOException e) {
              throw new RuntimeException(e);
          }
          return file;
      }
docs: create a new named file, and write the content into it.
  新建文件,并写文件,文件必须不存在
  
  @throws FileAlreadyExistsException FileAlreadyExistsException