public static File getFileFromDirectoryInClassPath ( String fileName , String classPath ) { Collection < String > paths = StringSupport . split ( classPath , ";:" , false ) ; for ( String singlePath : paths ) { File dir = new File ( singlePath ) ; if ( dir . isDirectory ( ) ) { File file = new File ( singlePath + ' ' + fileName ) ; if ( file . exists ( ) ) { return file ; } } } return null ; }
Locates a file in the classpath .