8067173: remove Utils::fileAsList

Reviewed-by: kvn, iignatyev
This commit is contained in:
Tatiana Pivovarova 2014-12-16 17:26:42 +03:00
parent 5ed29142e5
commit c9213782f3

View file

@ -306,25 +306,6 @@ public final class Utils {
} }
} }
/**
* Returns file content as a list of strings
*
* @param file File to operate on
* @return List of strings
* @throws IOException
*/
public static List<String> fileAsList(File file) throws IOException {
assertTrue(file.exists() && file.isFile(),
file.getAbsolutePath() + " does not exist or not a file");
List<String> output = new ArrayList<>();
try (BufferedReader reader = new BufferedReader(new FileReader(file.getAbsolutePath()))) {
while (reader.ready()) {
output.add(reader.readLine().replace(NEW_LINE, ""));
}
}
return output;
}
/** /**
* Return the contents of the named file as a single String, * Return the contents of the named file as a single String,
* or null if not found. * or null if not found.