package model;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Scanner;
import java.io.FileReader;
/**
 * Created by Elliad on 2016-05-08.
 */
public class FileModel {
    private static FileModel instance;
    private static File file;
    private static ArrayList<String> stringArrayList = new ArrayList<String>();

    private FileModel() { // 기본 생성자
    }
    public static FileModel getModel() { // 1개의 객체를 유지하기 위한 싱글톤
       if(instance == null)
           instance = new FileModel();
        return instance;
    }

    public boolean readFile(String filePath) { // 파일명 받기 및 읽기.
        file= new File(filePath);
        try(Scanner in = new Scanner(new FileReader(filePath)))
        {
            String tempString = "";
            while(in.hasNext()) {
                tempString = in.next(); //임시 텍스트에 개행을 제외한 한 줄을 불러온다
                if(in.hasNext()) tempString +="\n"; //다음 줄이 없을 때는 개행을 추가하지 않는다.
                stringArrayList.add(tempString);
            }
        } catch (FileNotFoundException e) {

            e.printStackTrace();
            return false;
        }
        return true;
    }

    public ArrayList<String> getStringArrayList()
    {
        return stringArrayList;
    }


    public boolean writeFile(String filePath) { // 파일명 받기 및 읽기
        try(  PrintWriter out = new PrintWriter(filePath) ){
            String tstring ="";
            for (String i : stringArrayList) {
                tstring+=i;
            }
            out.print(tstring);
            out.close();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
            return false;
        }
        return true;
    }

}

@@ -250,47 +250,9 @@
 l %7B%0A
-    private static FileModel instance;
 %0A
+
     
@@ -362,211 +362,9 @@
 );%0A%0A
-    private FileModel() %7B // %EA%B8%B0%EB%B3%B8 %EC%83%9D%EC%84%B1%EC%9E%90%0A    %7D%0A    public static FileModel getModel() %7B // 1%EA%B0%9C%EC%9D%98 %EA%B0%9D%EC%B2%B4%EB%A5%BC %EC%9C%A0%EC%A7%80%ED%95%98%EA%B8%B0 %EC%9C%84%ED%95%9C %EC%8B%B1%EA%B8%80%ED%86%A4%0A       if(instance == null)%0A           instance = new FileModel();%0A        return instance;%0A    %7D
+%0A
 %0A%0A  

Remove SingleTone Pattern of FileModel since The number of FileModel don't have to be ONE.