Skip to content

Instantly share code, notes, and snippets.

@LenarBad
Last active December 7, 2017 06:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LenarBad/ff31e4c960dfd6849d3592614357b840 to your computer and use it in GitHub Desktop.
Save LenarBad/ff31e4c960dfd6849d3592614357b840 to your computer and use it in GitHub Desktop.
How to read file into String with Commons IO
public String readFileIntoString(String fileName) throws IOException {
InputStream input = this.getClass().getResourceAsStream("/" + fileName);
return IOUtils.toString(input, StandardCharsets.UTF_8);
}
@LenarBad
Copy link
Author

LenarBad commented Dec 7, 2017

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