@@ -74,9 +74,6 @@ public ResultScreen(String title, String contextStr, String folderStr, String do
74
74
}else if (title .equals ("SearchCondition" )){
75
75
file = new File (folderStr + usv .toUpperFirst (domainStr ) + "SearchCondition.java" );
76
76
setTitle ("@" + title + " :" + usv .toUpperFirst (domainStr ) + "SearchCondition.java" );
77
- }else if (title .equals ("RootIndex" )){
78
- file = new File (folderStr + "index.html" );
79
- setTitle ("@" + title + " : /templates/firstInstance/index.html" );
80
77
}else if (title .equals ("Index" )){
81
78
file = new File (folderStr + "index.html" );
82
79
setTitle ("@" + title + " : /templates/firstInstance/" + usv .toLowerFirst (domainStr ) + "/index.html" );
@@ -96,14 +93,33 @@ public ResultScreen(String title, String contextStr, String folderStr, String do
96
93
file = new File (folderStr + usv .toUpperFirst (domainStr ) + "ApiDtoForm.java" );
97
94
setTitle ("@" + title + " : firstinstance.controller.firstinstanceurl.form." +usv .toUpperFirst (domainStr )+"ApiDtoForm.java" );
98
95
}
99
- if (!file .exists ()) {
96
+
97
+ if (file !=null ) {
100
98
file .createNewFile ();
99
+ FileWriter fw = new FileWriter (file );
100
+ BufferedWriter writer = new BufferedWriter (fw );
101
+ writer .write (contextStr );
102
+ writer .close ();
103
+ }
104
+
105
+ //중복파일이 발생할때... 파일이 지워지지 않아야하는 경우. 맨처음 CURD index파일. 여러 게시판으로 이동하는 링크가 있는 경우.
106
+ File file1 =null ;
107
+
108
+ if (title .equals ("RootIndex" )){
109
+ file1 = new File (folderStr + "index.html" );
110
+ setTitle ("@" + title + " : /templates/firstInstance/index.html" );
111
+ }
112
+
113
+ if (file1 !=null ) {
114
+ if (!file1 .exists ()) {
115
+ file1 .createNewFile ();
116
+ FileWriter fw1 = new FileWriter (file1 );
117
+ BufferedWriter writer1 = new BufferedWriter (fw1 );
118
+ writer1 .write (contextStr );
119
+ writer1 .close ();
120
+ }
101
121
}
102
122
103
- FileWriter fw = new FileWriter (file );
104
- BufferedWriter writer = new BufferedWriter (fw );
105
- writer .write (contextStr );
106
- writer .close ();
107
123
}catch (Exception e3 ){
108
124
e3 .printStackTrace ();
109
125
}
0 commit comments