mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-23 12:34:32 +02:00
8067173: remove Utils::fileAsList
Reviewed-by: kvn, iignatyev
This commit is contained in:
parent
5ed29142e5
commit
c9213782f3
1 changed files with 0 additions and 19 deletions
|
@ -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,
|
||||
* or null if not found.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue