Here you can find the source of existsInClasspath(final String fileName)
public static boolean existsInClasspath(final String fileName)
//package com.java2s; //License from project: Apache License import java.net.URL; public class Main { public static boolean existsInClasspath(final String fileName) { return getResourceFromClasspath(fileName) != null; }// w w w. j a v a 2s .c om public static URL getResourceFromClasspath(final String fileName) { return Thread.currentThread().getContextClassLoader().getResource(fileName); } }