/** * Gets the loader specified in the configuration file. * * @return TemplateLoader */ public static ResourceLoader getLoader(RuntimeServices rs, String loaderClassName) throws Exception { ResourceLoader loader = null; try { loader = ((ResourceLoader) Class.forName(loaderClassName).newInstance()); rs.info("Resource Loader Instantiated: " + loader.getClass().getName()); return loader; } catch (Exception e) { rs.error( "Problem instantiating the template loader.\n" + "Look at your properties file and make sure the\n" + "name of the template loader is correct. Here is the\n" + "error: " + StringUtils.stackTrace(e)); throw new Exception( "Problem initializing template loader: " + loaderClassName + "\nError is: " + StringUtils.stackTrace(e)); } }
private List<ResourceLoaderInfo> doGetResourceLoaders(final Module module) { final ModuleClassLoader classLoader = module.getClassLoaderPrivate(); final ResourceLoader[] loaders = classLoader.getResourceLoaders(); final ArrayList<ResourceLoaderInfo> list = new ArrayList<ResourceLoaderInfo>(loaders.length); for (ResourceLoader resourceLoader : loaders) { list.add( new ResourceLoaderInfo( resourceLoader.getClass().getName(), new ArrayList<String>(resourceLoader.getPaths()))); } return list; }