Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public String readFile(String filePath) {
- StringBuffer sb = new StringBuffer();
- try (BufferedReader br = new BufferedReader(new FileReader(filePath))) {
- String sCurrentLine;
- while ((sCurrentLine = br.readLine()) != null) {
- sb.append(sCurrentLine + "\n");
- }
- } catch (IOException e) {
- e.printStackTrace();
- }
- return sb.toString();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement