public static URL getResource ( String name , ClassLoader classLoader ) { Validate . notNull ( name , "resourceName must be not null" ) ; if ( name . startsWith ( "/" ) ) { name = name . substring ( 1 ) ; } if ( classLoader != null ) { URL url = classLoader . getResource ( name ) ; if ( url != null ) { return url ; } } ClassLoader loader = Thread . currentThread ( ) . getContextClassLoader ( ) ; if ( loader != null && loader != classLoader ) { URL url = loader . getResource ( name ) ; if ( url != null ) { return url ; } } return ClassLoader . getSystemResource ( name ) ; }
Finds the resource with the given name .