/** * Construct a new MultiMailer and instatiate all required Mailers * * @param mailerClass - The Class used to instantiate the Mailers * @param propertiesFile - the properties-file * @throws IOException if loading the properties fails */ public MultiMailer(Class<? extends M> mailerClass, File propertiesFile) throws IOException { this(mailerClass, PropertiesUtil.loadProperties(propertiesFile)); }
/** * Get the properties for the mailer with a given key and the config value defined in the global * properties for this multi mailer.<br> * <br> * By default a new Properties Object will be loaded from resources defined by the config value * with the global properties as it's parent:<br> * <br> * <code> * Properties mailerProperties = new Properties(properties);<br> * mailerProperties.putAll(PropertiesUtil.loadProperties(configValue));<br> * return mailerProperties;<br> * </code> * * @param key - the key for the mailer to get the properties for * @param configName - the config value defined in the global properties * @return * @throws IOException */ protected Properties getMailerProperties(String key, String configValue) throws IOException { Properties mailerProperties = new Properties(properties); mailerProperties.putAll(PropertiesUtil.loadProperties(configValue)); return mailerProperties; }