public Object findTemplateSource(String name) throws IOException { ClassPathTemplateSource source; if (relative && (anchorClass != null)) { StringBuilder pathBuilder = new StringBuilder(anchorClass.getPackage().getName().replace('.', '/')); pathBuilder.append('/').append(name); source = new ClassPathTemplateSource(classLoader, pathBuilder.toString()); } else { source = new ClassPathTemplateSource(classLoader, name); } return (source.exists()) ? source : null; }
public void closeTemplateSource(Object templateSource) throws IOException { ((ClassPathTemplateSource) templateSource).close(); }