public static URL getResource(String resource, Class<?> context, boolean checkParent)
    {
        URL url = Thread.currentThread().getContextClassLoader().getResource(resource);
        if (url != null)
            return url;

        if (context != null)
        {
            ClassLoader loader = context.getClassLoader();
            while (loader != null)
            {
                url = loader.getResource(resource);
                if (url != null)
                    return url;
                loader = checkParent ? loader.getParent() : null;
            }
        }

        return ClassLoader.getSystemResource(resource);
    }
Loads a {@link URL} resource from the classloader; If not found, the classloader of the {@code context} class
specified will be used. If the flag {@code checkParent} is true, the classloader's parent is included in the
lookup.
protostuff-parser/src/main/java/io/protostuff/parser/DefaultProtoLoader.java