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

2024年11月18日 13:45
有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();

}

}