(String path)
| 18 | public static volatile boolean _loaded = false; |
| 19 | |
| 20 | public static String readResource(String path) { |
| 21 | URL url = Library.class.getResource(path); |
| 22 | if (url == null) |
| 23 | return null; |
| 24 | try (InputStream is = url.openStream()) { |
| 25 | byte[] bytes = is.readAllBytes(); |
| 26 | return new String(bytes).trim(); |
| 27 | } catch (IOException e) { |
| 28 | return null; |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | public static synchronized void load() { |
| 33 | if (_loaded) return; |