code: public static URL getResource(Class<?> loadClass, String name,
  								  boolean checkParents) throws ClassNotFoundException {
  		URL url = null;
  		ClassLoader loader = Thread.currentThread().getContextClassLoader();
  		while (url == null && loader != null) {
  			url = loader.getResource(name);
  			loader = (url == null && checkParents) ? loader.getParent() : null;
  		}
  
  		loader = loadClass == null ? null : loadClass.getClassLoader();
  		while (url == null && loader != null) {
  			url = loader.getResource(name);
  			loader = (url == null && checkParents) ? loader.getParent() : null;
  		}
  
  		if (url == null) {
  			url = ClassLoader.getSystemResource(name);
  		}
  
  		return url;
  	}
docs: /* ------------------------------------------------------------