/** * Returns the resource specified by the <strong>relative</strong> name. * * @param name the name of the resource relative to the given class * @param c the source class * @return the url of the resource or null, if not found. */ public static URL getResourceRelative( final String name, final Class c ) { if ( name == null ) { throw new NullPointerException(); } final ClassLoader cl = getClassLoader( c ); final String cname = convertName( name, c ); if ( cl == null ) { return null; } return cl.getResource( cname ); }
/** * Returns the resource specified by the <strong>relative</strong> name. * * @param name the name of the resource relative to the given class * @param c the source class * @return the url of the resource or null, if not found. */ public static URL getResourceRelative(final String name, final Class c) { if (name == null) { throw new NullPointerException(); } final ClassLoader cl = getClassLoader(c); final String cname = convertName(name, c); if (cl == null) { return null; } return cl.getResource(cname); }