Here you can find the source of getFile(final String name)
public static File getFile(final String name) throws URISyntaxException
//package com.java2s; import java.io.File; import java.net.URISyntaxException; public class Main { public static File getFile(final String name) throws URISyntaxException { final File testFile = new File(Thread.currentThread().getContextClassLoader() .getResource("resources" + File.separator + name).toURI()); return testFile; }//w w w . j a v a2s . c o m }