Here you can find the source of getResource(final Class> baseClass, final String path)
public static URL getResource(final Class<?> baseClass, final String path) throws Exception
//package com.java2s; import java.net.URL; public class Main { public static URL getResource(final Class<?> baseClass, final String path) throws Exception { final URL url = baseClass.getClassLoader().getResource(path); return url; }/* ww w .j a va 2 s .co m*/ }