Here you can find the source of getResource(String name)
private static URL getResource(String name)
//package com.java2s; //License from project: Open Source License import java.net.URL; public class Main { private static URL getResource(String name) { return Thread.currentThread().getContextClassLoader().getResource(name); }//from w w w .java 2 s .c o m }