Skip to content

Commit

Permalink
Unused methods
Browse files Browse the repository at this point in the history
Change-Id: I17a4c8320988fd24250eeee6cab1229b9c9a2279
Reviewed-on: http://gerrit.dmdirc.com/4012
Reviewed-by: Greg Holmes <greg@dmdirc.com>
Automatic-Compile: DMDirc Build Manager
  • Loading branch information
csmith authored and DMDirc Build Manager committed Sep 19, 2014
1 parent 2488740 commit 397bc5d
Showing 1 changed file with 4 additions and 24 deletions.
28 changes: 4 additions & 24 deletions src/com/dmdirc/util/io/TextFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down Expand Up @@ -137,15 +138,15 @@ 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<String> getLines() throws IOException {
if (lines == null) {
readLines();
}

return lines;
return Collections.unmodifiableList(lines);
}

/**
Expand Down Expand Up @@ -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<String> lines) throws IOException {
public void writeLines(final Iterable<String> lines) throws IOException {
if (path == null) {
throw new UnsupportedOperationException("Cannot write to TextFile "
+ "opened with an InputStream");
Expand All @@ -197,27 +198,6 @@ public void writeLines(final List<String> 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.
*
Expand Down

0 comments on commit 397bc5d

Please sign in to comment.