public static URL getResourceURL ( String resource ) throws IOException { URL url = null ; ClassLoader loader = ResourcesUtils . 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