Browse Source

Unused methods

Change-Id: I17a4c8320988fd24250eeee6cab1229b9c9a2279
Reviewed-on: http://gerrit.dmdirc.com/4012
Reviewed-by: Greg Holmes <greg@dmdirc.com>
Automatic-Compile: DMDirc Build Manager
changes/12/4012/2
Chris Smith 9 years ago
parent
commit
397bc5d06b
1 changed files with 4 additions and 24 deletions
  1. 4
    24
      src/com/dmdirc/util/io/TextFile.java

+ 4
- 24
src/com/dmdirc/util/io/TextFile.java View File

30
 import java.nio.file.Files;
30
 import java.nio.file.Files;
31
 import java.nio.file.Path;
31
 import java.nio.file.Path;
32
 import java.util.ArrayList;
32
 import java.util.ArrayList;
33
+import java.util.Collections;
33
 import java.util.List;
34
 import java.util.List;
34
 
35
 
35
 /**
36
 /**
137
      * Retrieves the contents of the file as a list of lines. If getLines() or
138
      * Retrieves the contents of the file as a list of lines. If getLines() or
138
      * readLines() has previously been called, a cached version is returned.
139
      * readLines() has previously been called, a cached version is returned.
139
      *
140
      *
140
-     * @return A list of lines in the file
141
+     * @return An unmodifiable list of lines in the file
141
      * @throws IOException if an I/O exception occurs
142
      * @throws IOException if an I/O exception occurs
142
      */
143
      */
143
     public List<String> getLines() throws IOException {
144
     public List<String> getLines() throws IOException {
145
             readLines();
146
             readLines();
146
         }
147
         }
147
 
148
 
148
-        return lines;
149
+        return Collections.unmodifiableList(lines);
149
     }
150
     }
150
 
151
 
151
     /**
152
     /**
188
      * @param lines The lines to be written
189
      * @param lines The lines to be written
189
      * @throws IOException if an I/O exception occurs
190
      * @throws IOException if an I/O exception occurs
190
      */
191
      */
191
-    public void writeLines(final List<String> lines) throws IOException {
192
+    public void writeLines(final Iterable<String> lines) throws IOException {
192
         if (path == null) {
193
         if (path == null) {
193
             throw new UnsupportedOperationException("Cannot write to TextFile "
194
             throw new UnsupportedOperationException("Cannot write to TextFile "
194
                     + "opened with an InputStream");
195
                     + "opened with an InputStream");
197
         Files.write(path, lines, charset);
198
         Files.write(path, lines, charset);
198
     }
199
     }
199
 
200
 
200
-    /**
201
-     * Retrieves the File for this TextFile, if there is one.
202
-     *
203
-     * @return This TextFile's file, or null
204
-     */
205
-    public File getFile() {
206
-        if (path == null) {
207
-            return null;
208
-        }
209
-        return path.toFile();
210
-    }
211
-
212
-    /**
213
-     * Retrieves the Path for this TextFile, if there is one.
214
-     *
215
-     * @return This TextFile's path, or null
216
-     */
217
-    public Path getPath() {
218
-        return path;
219
-    }
220
-
221
     /**
201
     /**
222
      * Deletes the file associated with this textfile, if there is one.
202
      * Deletes the file associated with this textfile, if there is one.
223
      *
203
      *

Loading…
Cancel
Save