Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static String readTextFile(String fileName) {
- String returnValue = "";
- FileReader file = null;
- try {
- file = new FileReader(fileName);
- BufferedReader reader = new BufferedReader(file);
- String line = "";
- while ((line = reader.readLine()) != null) {
- //////System.out.println(line);
- //line = line.replace("~", "");
- //if (!line.endsWith("~")) line = line + "~";
- //if (line == "" || line.startsWith("~") || line.length() <= 1){
- // line = ChatColor.GREEN + " ~";
- //}
- returnValue += line;
- //////System.out.println(line);
- }
- } catch (Exception e) {
- e.printStackTrace();
- throw new RuntimeException(e);
- } finally {
- if (file != null) {
- try {
- file.close();
- } catch (IOException e) {
- // Ignore issues during closing
- }
- }
- }
- return returnValue;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement