import java.io.*;

String filePath = "/data/account.txt"; 
String conent = vars.get("account"); 
BufferedWriter out = null;

try {
   		File file = new File(filePath);
        File fileParent = file.getParentFile();
        if (!fileParent.exists()) { 
         fileParent.mkdirs();
        }
        file.createNewFile();
	out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file, true)));
	out.write(conent + "\r\n");
} catch (Exception e) {
	e.printStackTrace();
} finally {
	try {
		out.close();
	} catch (IOException e) {
		e.printStackTrace();
	}
}

  

相关文章:

  • 2021-07-07
  • 2022-02-13
  • 2022-12-23
  • 2021-08-03
  • 2022-12-26
  • 2021-11-18
  • 2021-10-29
  • 2021-06-13
猜你喜欢
  • 2022-01-14
  • 2021-11-21
  • 2022-12-23
  • 2022-01-06
  • 2022-02-14
  • 2022-12-23
相关资源
相似解决方案