/** * Locate the specified file and load the configuration. This does not change the source of the * configuration (i.e. the internally maintained file name). Use one of the setter methods for * this purpose. * * @param fileName the name of the file to be loaded * @throws ConfigurationException if an error occurs */ public void load(String fileName) throws ConfigurationException { try { URL url = ConfigurationUtils.locate(basePath, fileName); if (url == null) { throw new ConfigurationException("Cannot locate configuration source " + fileName); } load(url); } catch (ConfigurationException e) { throw e; } catch (Exception e) { throw new ConfigurationException("Unable to load the configuration file " + fileName, e); } }
/** * Return the URL where the configuration is stored. * * @return the configuration's location as URL */ public URL getURL() { return (sourceURL != null) ? sourceURL : ConfigurationUtils.locate(getBasePath(), getFileName()); }