Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static String loadResource(String fileName) throws Exception {
- String result = "";
- try (InputStream in = Resources.class.getClass().getResourceAsStream(fileName)) {
- Scanner scanner = new Scanner(in, "UTF-8");
- scanner.useDelimiter("\\A");
- result = scanner.next();
- scanner.close();
- }
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment