public static URL loadResourceFromClasspath(Class<?> clazz,String resourceName){
  URL ret=null;
  ret=clazz.getResource(resourceName);
  if (ret == null) {
    ret=clazz.getResource("/" + resourceName);
  }
  return ret;
}

public static URL loadResourceFromClasspath ( Class < ? > clazz , String resourceName ) { URL ret = null ; ret = clazz . getResource ( resourceName ) ; if ( ret == null ) { ret = clazz . getResource ( "/" + resourceName ) ; } return ret ; }
attempts to load a given resource from the classpath .
