private FactoryConfiguration loadFromClassPath(String location) { FactoryConfiguration factoryConfiguration = ConfigurationUtils.findInClasspath(location, this); if (logger.isInfoEnabled()) { String message = "The Toolbox Configuration can't be found In ServletContext , " + "thus try to locate in classpath[" + location + "], result : " + (factoryConfiguration != null ? "found !" : "not found !"); logger.info(message); } return factoryConfiguration; }
private FactoryConfiguration loadFromClassPath(String location) { FactoryConfiguration factoryConfiguration = ConfigurationUtils.findInClasspath(location, this); if (logger.isInfoEnabled()) { String message = "The Toolbox Configuration can't be found In ServletContext , " + "thus try to locate in classpath[" + location + "], result : " + (factoryConfiguration != null ? "found !" : "not found !"); logger.info(message); } return factoryConfiguration; }
/** * @param path configuration classpath * @return new {@link FactoryConfiguration} for the given classpath * @see #findInClasspath(String path, Object caller) */ public static FactoryConfiguration findInClasspath(String path) { // pretend this was called by a non-static ConfigurationUtils return findInClasspath(path, new ConfigurationUtils()); }
/** * Searches for a configuration file at the specified path and returns * it in the form of a {@link FactoryConfiguration}. This method will * look for a matching file in both the classpath and the file system. * If perchance a match is found in both, then both are loaded and the * configuration loaded from the file system is given precedence (i.e. * it is added onto the other). If no match is found in either, then * this will return {@code null}. * @param path configuration classpath or filesystem path * @return new {@link FactoryConfiguration} for the given path */ public static FactoryConfiguration find(String path) { FactoryConfiguration cp = findInClasspath(path); FactoryConfiguration fs = findInFileSystem(path); if (cp != null) { if (fs != null) { cp.addConfiguration(fs); } return cp; } else { return fs; } }
.tool( XmlTool.class ); FactoryConfiguration customConfig = ConfigurationUtils.findInClasspath( TOOLS_LOCATION );