80,337
社区成员
发帖
与我相关
我的任务
分享
public String getXml(String s) throws IOException{
String str = null;
StringBuffer sb = new StringBuffer();
File file = new File(s);
if(!file.exists())
Log.d("yinan", "##############################"); //作为调试,判断文件是否存在。结果无论s使用什么 存在于根目录的文件路径都为空!!
FileInputStream input = new FileInputStream(file);
BufferedReader br = new BufferedReader(new InputStreamReader(input));
while((str = br.readLine()) != null){
sb.append(str);
}
input.close();
br.close();
return sb.toString();
}