List of utility methods to do File to String
String | readFileAsString(String path) read File As String InputStream is = ClassLoader.getSystemResourceAsStream(path); InputStreamReader inputStreamREader = null; BufferedReader br = null; StringBuilder sb = new StringBuilder(); try { inputStreamREader = new InputStreamReader(is); br = new BufferedReader(inputStreamREader); String content = br.readLine(); ... |
String | readFileAsString(String path) read File As String StringBuffer sb = new StringBuffer(); InputStream in = new FileInputStream(path); BufferedReader reader = new BufferedReader(new InputStreamReader(in, "UTF-8")); String line = ""; while ((line = reader.readLine()) != null) { line = line.trim(); if (line == null || "".equals(line)) { continue; ... |