protected File findFile ( final List < File > sourceDirectories , String resourceFileName ) throws IOException { for ( final File sourceDirectory : sourceDirectories ) { final File resourceFile = new File ( sourceDirectory , resourceFileName ) ; if ( resourceFile . exists ( ) ) { return resourceFile ; } } throw new IOException ( "Failed to find resource " + resourceFileName + " in any of the source directories: " + sourceDirectories ) ; }
Find the File for the resource file in the various source directories .