Created
November 28, 2018 21:08
-
-
Save americanstone/c1ef03e6fbf61cc30a1b73d8952ae907 to your computer and use it in GitHub Desktop.
get content from resource folder
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
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