Skip to content

Instantly share code, notes, and snippets.

@americanstone
Created November 28, 2018 21:08
Show Gist options
  • Save americanstone/c1ef03e6fbf61cc30a1b73d8952ae907 to your computer and use it in GitHub Desktop.
Save americanstone/c1ef03e6fbf61cc30a1b73d8952ae907 to your computer and use it in GitHub Desktop.
get content from resource folder
private String getFileWithUtil(String fileName) {
String result = "";
ClassLoader classLoader = getClass().getClassLoader();
try {
result = IOUtils.toString(classLoader.getResourceAsStream(fileName));
} catch (IOException e) {
e.printStackTrace();
}
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment