File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
tmc-plugin/src/fi/helsinki/cs/tmc/model Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 11
11
import org .openide .filesystems .FileUtil ;
12
12
13
13
public class ConfigFile {
14
-
14
+
15
15
private final String name ;
16
16
private FileObject fileObject ;
17
-
17
+
18
18
public ConfigFile (String name ) {
19
19
this .name = name ;
20
20
}
21
-
21
+
22
22
public FileObject getFileObject () throws IOException {
23
23
if (fileObject == null ) {
24
24
FileObject root = FileUtil .getConfigRoot ();
@@ -33,19 +33,19 @@ public FileObject getFileObject() throws IOException {
33
33
}
34
34
return fileObject ;
35
35
}
36
-
36
+
37
37
public boolean exists () throws IOException {
38
38
return getFileObject ().getSize () > 0 ;
39
39
}
40
40
41
41
public Writer getWriter () throws IOException {
42
42
return new OutputStreamWriter (new BufferedOutputStream (getFileObject ().getOutputStream ()), "UTF-8" );
43
43
}
44
-
44
+
45
45
public Reader getReader () throws IOException {
46
46
return new InputStreamReader (new BufferedInputStream (getFileObject ().getInputStream ()), "UTF-8" );
47
47
}
48
-
48
+
49
49
public void writeContents (String s ) throws IOException {
50
50
Writer w = getWriter ();
51
51
try {
@@ -54,7 +54,7 @@ public void writeContents(String s) throws IOException {
54
54
w .close ();
55
55
}
56
56
}
57
-
57
+
58
58
public String readContents () throws IOException {
59
59
return getFileObject ().asText ("UTF-8" );
60
60
}
You can’t perform that action at this time.
0 commit comments