br.com.jhonsapp.email.configuration.Information.ConfigureUserInformation Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of email-dispatcher Show documentation
Show all versions of email-dispatcher Show documentation
Email Dispatcher is an open source project created by Jhonys Camacho and Jhonathan Camacho to facilitate the sending of emails.
package br.com.jhonsapp.email.configuration.Information;
import java.util.Properties;
import com.outjected.email.impl.SimpleMailConfig;
import br.com.jhonsapp.util.loader.PropertiesLoader;
public class ConfigureUserInformation {
private PropertiesLoader loader = new PropertiesLoader();
private SimpleMailConfig simpleMailConfig;
private Properties userProperties;
public Properties configure(SimpleMailConfig simpleMailConfig) {
this.simpleMailConfig = simpleMailConfig;
userProperties = loader.getPropertiesFile(PropertiesInformation.USER_PROPERTIES);
verifyIfAllUserInformationValuesExist();
addUserInformationInSimpleMailConfig();
return userProperties;
}
private void verifyIfAllUserInformationValuesExist(){
loader.verifyIfValueExists(userProperties, PropertiesInformation.typeKey);
loader.verifyIfValueExists(userProperties, PropertiesInformation.usernameKey);
loader.verifyIfValueExists(userProperties, PropertiesInformation.passwordKey);
}
private void addUserInformationInSimpleMailConfig(){
simpleMailConfig.setUsername(loader.getProperty(userProperties, PropertiesInformation.usernameKey));
simpleMailConfig.setPassword(loader.getProperty(userProperties, PropertiesInformation.passwordKey));
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy