public static URL locateOnClassPath ( String filename ) { URL result ; // first try to load from context class loader result = Thread . currentThread ( ) . getContextClassLoader ( ) . getResource ( filename ) ; // next try the current class loader which loaded p6spy if ( result == null ) { result = P6Util . class . getClassLoader ( ) . getResource ( filename ) ; } // finally try the system class loader if ( result == null ) { result = ClassLoader . getSystemResource ( filename ) ; } return result ; }
Locates a file on the classpath .