public static InputStream getResourceAsStream(String resource) throws IOException {
        InputStream in = null;
        ClassLoader loader = ResourceUtils.class.getClassLoader();
        if (loader != null) {
            in = loader.getResourceAsStream(resource);
        }
        if (in == null) {
            in = ClassLoader.getSystemResourceAsStream(resource);
        }
        if (in == null) {
            throw new IOException("Could not find resource " + resource);
        }
        return in;
    }
Returns a resource on the classpath as a Stream object

@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