(URL url)
| 21 | } |
| 22 | |
| 23 | public static String readResource(URL url) { |
| 24 | try (Reader reader = new InputStreamReader(url.openStream(), StandardCharsets.UTF_8)) { |
| 25 | StringBuilder builder = new StringBuilder(); |
| 26 | |
| 27 | int ch; |
| 28 | while ((ch = reader.read()) >= 0) { |
| 29 | builder.append((char) ch); |
| 30 | } |
| 31 | return builder.toString().trim(); |
| 32 | } catch (IOException e) { |
| 33 | return null; |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | @SneakyThrows |
| 38 | public static synchronized void load() { |
no test coverage detected