Skip to content

Instantly share code, notes, and snippets.

@LenarBad
Created December 8, 2017 18:23
Show Gist options
  • Select an option

  • Save LenarBad/fc9a8fda674c3fb33105917c55e5a522 to your computer and use it in GitHub Desktop.

Select an option

Save LenarBad/fc9a8fda674c3fb33105917c55e5a522 to your computer and use it in GitHub Desktop.
How to read file into String with Apache Commons IO
public List<String> getFileAsListOfStrings(String fileName) throws IOException {
InputStream input = this.getClass().getResourceAsStream("/" + fileName);
return IOUtils.readLines(input, StandardCharsets.UTF_8);
}
@LenarBad
Copy link
Copy Markdown
Author

LenarBad commented Dec 8, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment