1 public void testResourceFile() throws IOException {
2 File resource = new ClassPathResource("test.json").getFile();
3 String text = new String(Files.readAllBytes(resource.toPath()));
4 }
5
1 private void testResource(Resource resource) {
2 try {
3 InputStream resourcee = resource.getInputStream();
4 String text = null;
5 try (final Reader reader = new InputStreamReader(resourcee)) {
6 text = CharStreams.toString(reader);
7 }
8 System.out.println(text);
9
10 } catch (IOException e) {
11 e.printStackTrace();
12 }
13 }
14