private Templates getTemplates ( String filename ) { // InputStream is = // AnnotationViewGenerator.class.getResourceAsStream(filename); Templates templates ; InputStream is = null ; try { is = ResourceHelper . getInputStream ( "viewer/" + filename ) ; templates = mTFactory . newTemplates ( new StreamSource ( is ) ) ; } catch ( Exception e ) { throw new UIMARuntimeException ( e ) ; } finally { IOUtils . closeQuietly ( is ) ; } return templates ; }
Parses an XML file and produces a Templates object .