Last active
December 7, 2017 06:49
-
-
Save LenarBad/ff31e4c960dfd6849d3592614357b840 to your computer and use it in GitHub Desktop.
How to read file into String with Commons IO
This file contains 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 String readFileIntoString(String fileName) throws IOException { | |
InputStream input = this.getClass().getResourceAsStream("/" + fileName); | |
return IOUtils.toString(input, StandardCharsets.UTF_8); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to read file into String