code: public static URL getResource(String ref) {
  
  		URL url = null;
  		
  		for (int i=0;i<locations.size();i++) {
  			ResourceLocation location = (ResourceLocation) locations.get(i);
  			url = location.getResource(ref);
  			if (url != null) {
  				break;
  			}
  		}
  		
  		if (url == null)
  		{
  			throw new RuntimeException("Resource not found: "+ref);
  		}
  			
  		return url;
  	}
docs: Get a resource as a URL
  
  @param ref The reference to the resource to retrieve
  @return A URL from which the resource can be read