Here you can find the source of getResourcePath(String filename)
static String getResourcePath(String filename) throws URISyntaxException
//package com.java2s; //License from project: Apache License import java.net.URISyntaxException; public class Main { static String getResourcePath(String filename) throws URISyntaxException { ClassLoader classloader = Thread.currentThread() .getContextClassLoader(); return classloader.getResource(filename).toURI().toString(); }/* ww w. j a v a 2 s .c o m*/ }