question: public static void copyResourceFromClass ( Class clazz , String file , File toFile ) throws IOException { try ( InputStream ins = clazz . getResourceAsStream ( clazz . getSimpleName ( ) + "/" + file ) ) { if ( ins == null ) { throw new IllegalStateException ( "Resource file " + file + " not found" ) ; } FileUtils . copyInputStreamToFile ( ins , toFile ) ; } }
target:  Unused and replaced with resources dir.