java怎样读取本地文件夹下的文件
2个回答
展开全部
File file = new File("WebRoot\\test.html");
BufferedReader bufferedReader =
new BufferedReader(new InputStreamReader(new FileInputStream(file)));
String row = null;
StringBuffer sb = new StringBuffer();
while ((row = bufferedReader.readLine()) != null) {
System.out.println(row);
sb.append(row);
}
bufferedReader .close();
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询