public static InputStream getResourceAsStream(String name) {

        InputStream is = THREAD_CL_ACCESSOR.getResourceStream(name);

        if (is == null) {
            if (LOGGER.isTraceEnabled()) {
                LOGGER.trace("Resource [" + name + "] was not found via the thread context ClassLoader.  Trying the "
                        + "current ClassLoader...");
            }
            is = CLASS_LANG_CL_ACCESSOR.getResourceStream(name);
        }

        if (is == null) {
            if (LOGGER.isTraceEnabled()) {
                LOGGER.trace("Resource [" + name + "] was not found via the org.apache.shiro.lang ClassLoader.  Trying the "
                        + "additionally set ClassLoader...");
            }
            is = ADDITIONAL_CL_ACCESSOR.getResourceStream(name);
        }

        if (is == null) {
            if (LOGGER.isTraceEnabled()) {
                LOGGER.trace("Resource [" + name + "] was not found via the current class loader.  Trying the "
                        + "system/application ClassLoader...");
            }
            is = SYSTEM_CL_ACCESSOR.getResourceStream(name);
        }

        if (is == null && LOGGER.isTraceEnabled()) {
            LOGGER.trace("Resource [" + name + "] was not found via the thread context, current, or "
                    + "system/application ClassLoaders.  All heuristics have been exhausted.  Returning null.");
        }

        return is;
    }
Returns the specified resource by checking the current thread's
{@link Thread#getContextClassLoader() context class loader}, then the
current ClassLoader (<code>ClassUtils.class.getClassLoader()</code>), then the system/application
ClassLoader (<code>ClassLoader.getSystemClassLoader()</code>, in that order, using
{@link ClassLoader#getResourceAsStream(String) getResourceAsStream(name)}.

@param name the name of the resource to acquire from the classloader(s).
@return the InputStream of the resource found, or <code>null</code> if the resource cannot be found from any
of the three mentioned ClassLoaders.
@since 0.9
lang/src/main/java/org/apache/shiro/lang/util/ClassUtils.java