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

Method getGateResourceAsStream

src/main/java/gate/util/Files.java:375–381  ·  view source on GitHub ↗

Get a resource from the GATE resources directory as an InputStream. The resource name should be relative to resourcePath which is equal with gate/resources ; e.g. for a resource stored as gate/resources/jape/Test11.jape , this method should be passed the name jape/Te

(String resourceName)

Source from the content-addressed store, hash-verified

373 * this method should be passed the name <TT>jape/Test11.jape</TT>.
374 */
375 public static InputStream getGateResourceAsStream(String resourceName)
376 throws IOException {
377
378 if(resourceName.startsWith("/") || resourceName.startsWith("\\") )
379 return getResourceAsStream(resourcePath + resourceName);
380 else return getResourceAsStream(resourcePath + "/" + resourceName);
381 } // getResourceAsStream(String)
382
383 /**
384 * Get a resource from the GATE ClassLoader. The return value is a

Callers 6

testGetResourcesMethod · 0.95
testWriteTempFileMethod · 0.95
GateClass · 0.95
createResourceMethod · 0.95

Calls 1

getResourceAsStreamMethod · 0.95

Tested by 2

testGetResourcesMethod · 0.76
testWriteTempFileMethod · 0.76