|
|
@@ -86,11 +86,18 @@ public class Document implements DocumentInterface {
|
|
86
|
86
|
}
|
|
87
|
87
|
|
|
88
|
88
|
@Override
|
|
89
|
|
- public void replaceAll(String stringToReplace, String replacementString) {
|
|
|
89
|
+ public void replaceAll(String stringToReplace, String replacementString) throws IOException {
|
|
|
90
|
+ write(
|
|
|
91
|
+ read()
|
|
|
92
|
+ .replaceAll(stringToReplace, replacementString)
|
|
|
93
|
+ );
|
|
90
|
94
|
}
|
|
91
|
95
|
|
|
92
|
96
|
@Override
|
|
93
|
|
- public void overWrite(String content) {
|
|
|
97
|
+ public void overWrite(String content) throws IOException {
|
|
|
98
|
+ FileWriter overWriter = new FileWriter(file, false);
|
|
|
99
|
+ overWriter.write(content);
|
|
|
100
|
+ overWriter.flush();
|
|
94
|
101
|
}
|
|
95
|
102
|
|
|
96
|
103
|
public List<String> toList() {
|
|
|
@@ -99,11 +106,12 @@ public class Document implements DocumentInterface {
|
|
99
|
106
|
|
|
100
|
107
|
@Override
|
|
101
|
108
|
public File getFile() {
|
|
102
|
|
- return null;
|
|
|
109
|
+ return file;
|
|
103
|
110
|
}
|
|
104
|
111
|
|
|
105
|
112
|
@Override
|
|
106
|
113
|
public String toString() {
|
|
107
|
|
- return null;
|
|
|
114
|
+ StringBuilder builder = new StringBuilder();
|
|
|
115
|
+ return builder.append(file.toString() + "{" +read()).toString() + "}";
|
|
108
|
116
|
}
|
|
109
|
117
|
}
|