Here you can find the source of getResourcePath(String name)
public static String getResourcePath(String name)
//package com.java2s; //License from project: Mozilla Public License import java.net.URL; public class Main { public static String getResourcePath(String name) { URL pathUrl = Thread.currentThread().getContextClassLoader().getResource(name); if (pathUrl != null) { return pathUrl.getPath(); }/* w w w. j av a 2s .co m*/ return null; } }