code: public URL getResource(final String name) {
  		final String normalizedName = Path.normalizeResourcePath(rootPath
  				+ (name.startsWith("/") ? "" : "/") + name).trim();
  
  		log.debug("Searching bundle " + bundle
  						+ " for resource [{}], normalized to [{}]", name,
  				normalizedName);
  
  		URL url = resourceCache.get(normalizedName);
  
  		if (url == null && !normalizedName.isEmpty()) {
  			url = bundle.getEntry(normalizedName);
  			if (url == null) {
  				log.debug("getEntry failed, trying with /META-INF/resources/ in bundle class space");
  				// Search attached bundles for web-fragments
  				Set<Bundle> bundlesInClassSpace = ClassPathUtil.getBundlesInClassSpace(bundle, new HashSet<>());
  				for (Bundle bundleInClassSpace : bundlesInClassSpace) {
  					url = bundleInClassSpace.getEntry("/META-INF/resources/" + normalizedName);
  					if (url != null) {
  						break;
  					}
  				}
  			}
  			// obviously still not found might be available from a attached bundle resource
  			if (url == null) {
  				log.debug("getEntry failed, fallback to getResource");
  				url = bundle.getResource(normalizedName);
  			}
  			if (url == null) {
  				url = NO_URL;
  			}
  			resourceCache.putIfAbsent(normalizedName, url);
  		}
  
  		if (url != null && url != NO_URL) {
  			log.debug("Resource found as url [{}]", url);
  		} else {
  			log.debug("Resource not found");
  			url = null;
  		}
  		return url;
  	}
docs: Searches for the resource in the bundle that published the service.
  
  @see org.osgi.service.http.HttpContext#getResource(String)