删除文件内容输出
This commit is contained in:
parent
da93ba3cb6
commit
9b4365d228
@ -1,80 +1,58 @@
|
||||
package com.tenwa.collectaudit.cache;
|
||||
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileReader;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.Scanner;
|
||||
|
||||
|
||||
public class InterFaceFileCreate {
|
||||
|
||||
/**
|
||||
* 生成送盘文件
|
||||
* @param sendData
|
||||
* @param fileSavePath
|
||||
* @param fileName
|
||||
*/
|
||||
public static void sendDiscFileCreate(String sendData,String fileSavePath,String fileName) {
|
||||
try {
|
||||
File file = new File(fileSavePath);
|
||||
System.out.println(file.getAbsolutePath());
|
||||
if(!file.exists()){//目录不存在则直接创建
|
||||
file.mkdirs();
|
||||
}
|
||||
String filePath = file.getAbsolutePath();
|
||||
FileWriter fileWriter = new FileWriter(filePath+"/"+fileName+".txt");
|
||||
|
||||
/**
|
||||
* 生成送盘文件
|
||||
*
|
||||
* @param sendData
|
||||
* @param fileSavePath
|
||||
* @param fileName
|
||||
*/
|
||||
public static void sendDiscFileCreate(String sendData, String fileSavePath, String fileName) {
|
||||
try {
|
||||
File file = new File(fileSavePath);
|
||||
if (!file.exists()) {//目录不存在则直接创建
|
||||
file.mkdirs();
|
||||
}
|
||||
String filePath = file.getAbsolutePath();
|
||||
FileWriter fileWriter = new FileWriter(filePath + "/" + fileName + ".txt");
|
||||
String ss = sendData;
|
||||
fileWriter.write(ss);
|
||||
fileWriter.write(ss);
|
||||
fileWriter.flush();
|
||||
fileWriter.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
FileReader fileReader = new FileReader(filePath+"/"+fileName+".txt");
|
||||
BufferedReader br = new BufferedReader(fileReader);
|
||||
String s;
|
||||
while ((s = br.readLine()) != null) {
|
||||
System.out.println(s);
|
||||
/**
|
||||
* 生成回盘文件
|
||||
*
|
||||
* @param replyData
|
||||
* @param fileSavePath
|
||||
* @param fileName
|
||||
*/
|
||||
public static void replyDiscFileCreate(String replyData, String fileSavePath, String fileName) {
|
||||
try {
|
||||
File file = new File(fileSavePath);
|
||||
if (!file.exists()) {//目录不存在则直接创建
|
||||
file.mkdirs();
|
||||
}
|
||||
fileReader.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成回盘文件
|
||||
* @param replyData
|
||||
* @param fileSavePath
|
||||
* @param fileName
|
||||
*/
|
||||
public static void replyDiscFileCreate(String replyData,String fileSavePath,String fileName) {
|
||||
try {
|
||||
File file = new File(fileSavePath);
|
||||
System.out.println(file.getAbsolutePath());
|
||||
if(!file.exists()){//目录不存在则直接创建
|
||||
file.mkdirs();
|
||||
}
|
||||
String filePath = file.getAbsolutePath();
|
||||
FileWriter fileWriter = new FileWriter(filePath+"/"+fileName+".rnt");
|
||||
String ss = replyData;
|
||||
fileWriter.write(ss);
|
||||
fileWriter.flush();
|
||||
fileWriter.close();
|
||||
|
||||
FileReader fileReader = new FileReader(filePath+"/"+fileName+".rnt");
|
||||
BufferedReader br = new BufferedReader(fileReader);
|
||||
String s;
|
||||
while ((s = br.readLine()) != null) {
|
||||
System.out.println(s);
|
||||
}
|
||||
fileReader.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
String filePath = file.getAbsolutePath();
|
||||
FileWriter fileWriter = new FileWriter(filePath + "/" + fileName + ".rnt");
|
||||
String ss = replyData;
|
||||
fileWriter.write(ss);
|
||||
fileWriter.flush();
|
||||
fileWriter.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user