Code example for FileNotFoundException

0
	 */ 
	public static void initLogging(String location) throws FileNotFoundException {
		String resolvedLocation = SystemPropertyUtils.resolvePlaceholders(location);
		URL url = ResourceUtils.getURL(resolvedLocation);
		if (ResourceUtils.URL_PROTOCOL_FILE.equals(url.getProtocol()) && !ResourceUtils.getFile(url).exists()) {
			throw new FileNotFoundException("Log4j config file [" + resolvedLocation + "] not found");
		} 
 
		if (resolvedLocation.toLowerCase().endsWith(XML_FILE_EXTENSION)) {
			DOMConfigurator.configure(url);
		} 
		else { 
			PropertyConfigurator.configure(url);
		} 
	} 
 
	/** 
	 * Initialize log4j from the given location, with the given refresh interval 
	 * for the config file. Assumes an XML file in case of a ".xml" file extension, 
	 * and a properties file otherwise.