MCPcopy Create free account
hub / github.com/HumbleUI/JWM / readResource

Method readResource

shared/java/impl/Library.java:20–30  ·  view source on GitHub ↗
(String path)

Source from the content-addressed store, hash-verified

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;

Callers 1

loadMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected