@ Override public URL findResource ( final String _name ) { URL ret = null ; final String name = _name . replaceAll ( System . getProperty ( "file.separator" ) , "." ) . replaceAll ( ".class" , "" ) ; final byte [ ] data = loadClassData ( name ) ; if ( data != null && data . length > 0 ) { final File file = FileUtils . getFile ( EFapsClassLoader . getTempFolder ( ) , name ) ; try { if ( ! file . exists ( ) || FileUtils . isFileOlder ( file , new DateTime ( ) . minusHours ( 1 ) . toDate ( ) ) ) { FileUtils . writeByteArrayToFile ( file , data ) ; } ret = file . toURI ( ) . toURL ( ) ; } catch ( final IOException e ) { EFapsClassLoader . LOG . error ( "Could not geneate File for reading from URL: {}" , name ) ; } } return ret ; }
In case of jbpm this is necessary for compiling because they search the classes with URL .