From 397bc5d06b72550c1795b7888bc70d150ea995b5 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Fri, 19 Sep 2014 12:17:28 +0100 Subject: [PATCH] Unused methods Change-Id: I17a4c8320988fd24250eeee6cab1229b9c9a2279 Reviewed-on: http://gerrit.dmdirc.com/4012 Reviewed-by: Greg Holmes Automatic-Compile: DMDirc Build Manager --- src/com/dmdirc/util/io/TextFile.java | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/src/com/dmdirc/util/io/TextFile.java b/src/com/dmdirc/util/io/TextFile.java index 706bcb2..560d84c 100644 --- a/src/com/dmdirc/util/io/TextFile.java +++ b/src/com/dmdirc/util/io/TextFile.java @@ -30,6 +30,7 @@ import java.nio.file.Files; import java.nio.file.Path; import java.util.ArrayList; +import java.util.Collections; import java.util.List; /** @@ -137,7 +138,7 @@ public TextFile(final InputStream is, final Charset charset) { * Retrieves the contents of the file as a list of lines. If getLines() or * readLines() has previously been called, a cached version is returned. * - * @return A list of lines in the file + * @return An unmodifiable list of lines in the file * @throws IOException if an I/O exception occurs */ public List getLines() throws IOException { @@ -145,7 +146,7 @@ public List getLines() throws IOException { readLines(); } - return lines; + return Collections.unmodifiableList(lines); } /** @@ -188,7 +189,7 @@ public boolean isWritable() { * @param lines The lines to be written * @throws IOException if an I/O exception occurs */ - public void writeLines(final List lines) throws IOException { + public void writeLines(final Iterable lines) throws IOException { if (path == null) { throw new UnsupportedOperationException("Cannot write to TextFile " + "opened with an InputStream"); @@ -197,27 +198,6 @@ public void writeLines(final List lines) throws IOException { Files.write(path, lines, charset); } - /** - * Retrieves the File for this TextFile, if there is one. - * - * @return This TextFile's file, or null - */ - public File getFile() { - if (path == null) { - return null; - } - return path.toFile(); - } - - /** - * Retrieves the Path for this TextFile, if there is one. - * - * @return This TextFile's path, or null - */ - public Path getPath() { - return path; - } - /** * Deletes the file associated with this textfile, if there is one. *