读取文件信息
1 /** 2 * 读取文件信息 3 * @param src 文件路径 4 * @return String 5 */ 6 public static String readCacert(String src) { 7 StringBuilder sb = new StringBuilder(); 8 try { 9 BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(new File(src)))); 10 String CacertStr = null; 11 while (null != (CacertStr = br.readLine())) { 12 sb.append(CacertStr); 13 } 14 br.close(); 15 } catch (Exception e) { 16 e.printStackTrace(); 17 } 18 return sb.toString(); 19 }