Finds the ResourceHandle object for the resource with the specified name.

@param name the name of the resource
@return the ResourceHandle of the resource
968414
protected ResourceHandle getResourceHandle(final String name)
    {
        return AccessController.doPrivileged(new PrivilegedAction<ResourceHandle>()
        {
            @Override
            public ResourceHandle run()
            {
                return URIClassLoader.this.finder.getResource(name);
            }
        }, this.acc);
    }
613286
public URL getResource(String name)
    {
        URL url= null;
        boolean tried_parent= false;
        if (_parent!=null &&(_java2compliant || isSystemPath(name)))
        {
            if (log.isTraceEnabled())
                log.trace("try getResource " + name + " from " + _parent);
            tried_parent= true;
            url= _parent.getResource(name);
        }

        if (url == null)
        {
            if (log.isTraceEnabled())
                log.trace("try findResource " + name + " from " + _urlClassPath);
            url= this.findResource(name);

            if (url == null && name.startsWith("/"))
            {
                if (log.isDebugEnabled())
                    log.debug("HACK leading / off " + name);
                url= this.findResource(name.substring(1));
            }
        }

        if (_parent!=null && url == null && !tried_parent)
        {
            if (log.isTraceEnabled())
                log.trace("try getResource " + name + " from " + _parent);
            url= _parent.getResource(name);
        }

        if (url != null)
            if (log.isTraceEnabled())
                log.trace("found " + url);

        return url;
    }
959613
public URL getResourceURL(String name) {
		if (name.length() == 0) return null;
		if (name.charAt(0) == '/') name = name.substring(1);
    	for (int i = 0; i < libs.size(); i++) {
    		AbstractClassLoader cl = libs.get(i);
    		URL url = cl.loadResourceURL(name);
    		if (url != null) return url;
    	}
    	// then try on the core one
    	return AppClassLoader.class.getClassLoader().getResource(name);
	}
590991
@Nullable
  public URL getResource (final String name)
  {
    URL ret = null;

    if (m_aBestCandidate != null)
    {
      ret = m_aBestCandidate.getResource (name);
      if (ret != null)
        return ret;
      m_aBestCandidate = null;
    }

    IClassLoadHelper aLoadHelper = null;

    final Iterator <IClassLoadHelper> iter = m_aLoadHelpers.iterator ();
    while (iter.hasNext ())
    {
      aLoadHelper = iter.next ();
      ret = aLoadHelper.getResource (name);
      if (ret != null)
        break;
    }

    m_aBestCandidate = aLoadHelper;
    return ret;
  }
1239022
public URLConnection getResourceConnection (String name) throws ResourceException {
        name = removeNamePrefix(name).replace('\\', '/');

        //remove the leading / as we are trying with a leading / now
        if (name.startsWith("WEB-INF/groovy/")) {
            name = name.substring(15);//just for uniformity
        } else if (name.startsWith("/")) {
            name = name.substring(1);
        }

        /*
        * Try to locate the resource and return an opened connection to it.
        */
        try {
            URL url = servletContext.getResource('/' + name);
            if (url == null) {
                url = servletContext.getResource("/WEB-INF/groovy/" + name);
            }
            if (url == null) {
                throw new ResourceException("Resource \"" + name + "\" not found!");
            }
            return url.openConnection();
        } catch (IOException e) {
            throw new ResourceException("Problems getting resource named \"" + name + "\"!", e);
        }
    }
511812
@Override
    protected Enumeration<URL> findResources(String name) {
        URL url = findResource(name);
        Vector<URL> urls = new Vector<>();
        if (url != null) {
            urls.add(url);
        }
        return urls.elements();
    }
644107
static InputStream getResourceAsStream(final String name)
   {
      if (System.getSecurityManager() == null)
         return Thread.currentThread().getContextClassLoader().getResourceAsStream(name);

      return AccessController.doPrivileged(new PrivilegedAction<InputStream>() 
      {
         public InputStream run()
         {
            return Thread.currentThread().getContextClassLoader().getResourceAsStream(name);
         }
      });
   }
1163380
public static function getResource(string $name)
    {
        $resource = static::getInstance($name)->getResource();

        if(RequestContext::exsits() && $resource)
        {
            static::pushResourceToRequestContext($resource);
        }

        return $resource;
    }
472331
public InputStream getResourceAsStream(final String name) {
        for ( final ClassLoader classLoader : this.classLoaders ) {
            InputStream stream = classLoader.getResourceAsStream( name );
            if ( stream != null ) {
                return stream;
            }
        }

        return null;
    }
500352
@Override
	@Pure
	public Enumeration<URL> findResources(final String name) throws IOException {
		final Enumeration<?> e = this.ucp.findResources(name, true);

		return new Enumeration<URL>() {
			private URL url;

			private boolean next() {
				if (this.url != null) {
					return true;
				}
				do {
					final URL u = AccessController.doPrivileged(new PrivilegedAction<URL>() {
						@Override
						public URL run() {
							if (!e.hasMoreElements()) {
								return null;
							}
							return (URL) e.nextElement();
						}
					}, DynamicURLClassLoader.this.acc);
					if (u == null) {
						break;
					}
					this.url = DynamicURLClassLoader.this.ucp.checkURL(u);
				}
				while (this.url == null);

				return this.url != null;
			}

			@Override
			public URL nextElement() {
				if (!next()) {
					throw new NoSuchElementException();
				}
				final URL u = this.url;
				this.url = null;
				return u;
			}

			@Override
			public boolean hasMoreElements() {
				return next();
			}
		};
	}
700054
@Override
  public URL getResource(String name) {

    URL result = null;

    if (bestCandidate != null) {
      result = bestCandidate.getResource(name);
      if (result == null) {
        bestCandidate = null;
      }
    }

    ClassLoadHelper loadHelper = null;

    Iterator<ClassLoadHelper> iter = loadHelpers.iterator();
    while (iter.hasNext()) {
      loadHelper = iter.next();

      result = loadHelper.getResource(name);
      if (result != null) {
        break;
      }
    }

    bestCandidate = loadHelper;
    return result;
  }
851391
public T get(final String name) {
        for (final T i : this) {
            if (i.getName().equals(name)) {
                return i;
            }
        }
        return null;
    }
1179417
protected final Optional<URL> defaultGetResource(String name) {
        return Optional.ofNullable(getClassLoader().getResource(name));
    }
68229
@Override
    protected URL findResource(String name) {
        try {
            return Whitebox.invokeMethod(deferTo, "findResource", name);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
28269
@SuppressWarnings("unchecked")
    public <R> R getHeader(String name) {
        return (R) headers().get(name);
    }
379330
public Resource getResource(String name, String encoding) throws IOException {
        return getResource(name, null, encoding);
    }
982146
public static void checkResourceName(String name) {

        try {
            CmsResource.checkResourceName(name);
        } catch (CmsIllegalArgumentException e) {
            throw new CmisNameConstraintViolationException(e.getLocalizedMessage(), e);
        }
    }