java自动化测试日志的文件路径怎么设置

2024-11-18 13:45:00
推荐回答(1个)
回答1:

import java.io.*;

/**
* Created by liuyikai on 2016/8/13.
*/
public class FileUtil {

public static String LoadContentByPath(String path) throws IOException {
InputStream is = new FileInputStream(path);
BufferedReader in = new BufferedReader(new InputStreamReader(is));
StringBuffer buffer = new StringBuffer();
String line = "";
while ((line = in.readLine()) != null){
buffer.append(line);
}
return buffer.toString();

}

}