Here you can find the source of getResourceUrl(final Class> aClass, final String aPath)
public static URL getResourceUrl(final Class<?> aClass, final String aPath) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.FileNotFoundException; import java.io.IOException; import java.net.URL; public class Main { public static URL getResourceUrl(final Class<?> aClass, final String aPath) throws IOException { final URL url = aClass.getResource(aPath); if (url == null) { throw new FileNotFoundException("Resource not found for " + aClass.toString() + ": " + aPath); } else {/* ww w . j a va 2 s. com*/ return url; } } }