public static URL getResourceURL(String resource) throws IOException {
        URL url = null;
        ClassLoader loader = ResourceUtils.class.getClassLoader();
        if (loader != null) {
            url = loader.getResource(resource);
        }
        if (url == null) {
            url = ClassLoader.getSystemResource(resource);
        }
        if (url == null) {
            throw new IOException("Could not find resource " + resource);
        }
        return url;
    }
Returns the URL of the resource on the classpath

@param resource
           The resource to find
@throws IOException
            If the resource cannot be found or read
@return The resource
metamorphosis-commons/src/main/java/com/taobao/metamorphosis/utils/ResourceUtils.java