MCPcopy Create free account
hub / github.com/GateNLP/gate-core / getResource

Method getResource

src/main/java/gate/util/GateClassLoader.java:123–151  ·  view source on GitHub ↗
(String name)

Source from the content-addressed store, hash-verified

121 }
122
123 @Override
124 public URL getResource(String name) {
125 URL result = null;
126
127 result = super.getResource(name);
128 if(result != null) return result;
129
130 if(getParent() == null) {
131 result = Gate.getClassLoader().findResource(name);
132 if(result != null) return result;
133
134 result = Gate.getClassLoader().getParent().getResource(name);
135 if (result != null) return result;
136 }
137
138 Set<GateClassLoader> children;
139 synchronized(childClassLoaders) {
140 children = new LinkedHashSet<GateClassLoader>(childClassLoaders.values());
141 }
142
143 for(GateClassLoader cl : children) {
144 if(!cl.isIsolated()) {
145 result = cl.getResource(name);
146 if(result != null) return result;
147 }
148 }
149
150 return null;
151 }
152
153 @Override
154 public Class<?> loadClass(String name) throws ClassNotFoundException {

Callers

nothing calls this directly

Calls 4

getClassLoaderMethod · 0.95
isIsolatedMethod · 0.80
getParentMethod · 0.65
valuesMethod · 0.45

Tested by

no test coverage detected