Created
December 8, 2017 18:23
-
-
Save LenarBad/fc9a8fda674c3fb33105917c55e5a522 to your computer and use it in GitHub Desktop.
How to read file into String with Apache Commons IO
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public List<String> getFileAsListOfStrings(String fileName) throws IOException { | |
| InputStream input = this.getClass().getResourceAsStream("/" + fileName); | |
| return IOUtils.readLines(input, StandardCharsets.UTF_8); | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to read file into list of Strings