public Template getTemplate ( String fileName ) { if ( fileName . charAt ( 0 ) != ' ' ) { char [ ] arr = new char [ fileName . length ( ) + 1 ] ; fileName . getChars ( 0 , fileName . length ( ) , arr , 1 ) ; arr [ 0 ] = ' ' ; fileName = new String ( arr ) ; } Template template = templateCache . get ( fileName ) ; if ( template == null ) { template = buildTemplateBySourceFactory ( fileName ) ; templateCache . put ( fileName , template ) ; } else if ( devMode ) { if ( template . isModified ( ) ) { template = buildTemplateBySourceFactory ( fileName ) ; templateCache . put ( fileName , template ) ; } } return template ; }
Get template by file name