附件补充下载
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
546 B

  1. package com.bw.fileDownload.utils;
  2. import java.io.FileWriter;
  3. import java.io.IOException;
  4. /**
  5. * 文件工具类
  6. * @author jian.mao
  7. * @date 2023年7月14日
  8. * @description
  9. */
  10. public class FileUtil {
  11. /**
  12. * 数据写入文件
  13. * @param Path 文件路径
  14. * @param result 数据
  15. * @throws IOException
  16. */
  17. public static void writeFile(String path,String result){
  18. try {
  19. FileWriter fw = new FileWriter(path,true);
  20. fw.write(result+"\n");
  21. fw.flush();
  22. fw.close();
  23. } catch (Exception e) {
  24. e.printStackTrace();
  25. }
  26. }
  27. }