MCPcopy Create free account
hub / github.com/apache/pig / locateJarFromResources

Method locateJarFromResources

src/org/apache/pig/PigServer.java:574–597  ·  view source on GitHub ↗
(String jarName)

Source from the content-addressed store, hash-verified

572 }
573
574 private URL locateJarFromResources(String jarName) throws IOException {
575 Enumeration<URL> urls = ClassLoader.getSystemResources(jarName);
576 URL resourceLocation = null;
577
578 if (urls.hasMoreElements()) {
579 resourceLocation = urls.nextElement();
580 }
581
582 if (urls.hasMoreElements()) {
583 StringBuffer sb = new StringBuffer("Found multiple resources that match ");
584 sb.append(jarName);
585 sb.append(": ");
586 sb.append(resourceLocation);
587
588 while (urls.hasMoreElements()) {
589 sb.append(urls.nextElement());
590 sb.append("; ");
591 }
592
593 log.debug(sb.toString());
594 }
595
596 return resourceLocation;
597 }
598
599 /**
600 * Registers a jar file. Name of the jar file can be an absolute or

Callers 1

registerJarMethod · 0.95

Calls 5

hasMoreElementsMethod · 0.80
nextElementMethod · 0.80
debugMethod · 0.80
appendMethod · 0.65
toStringMethod · 0.45

Tested by

no test coverage detected