示例#1
0
 protected PasswordAuthentication getPasswordAuthentication() {
   PasswordAuthentication passwordAuthentication =
       new PasswordAuthentication(
           Environment.getValue(Environment.PROP_EMAIL_SMTP_USERNAME),
           Encryption.getEncryptedProperty(Environment.PROP_EMAIL_SMTP_PASSWORD, null));
   if (logger.isDebugEnabled()) {
     logger.debug("Authenticating with: " + passwordAuthentication);
   }
   return passwordAuthentication;
 }
示例#2
0
 private boolean previousInstall() {
   String driver = Environment.getValue(Environment.PROP_DB_DRIVER);
   String url = Environment.getValue(Environment.PROP_DB_URL);
   String userName = Environment.getValue(Environment.PROP_DB_USERNAME);
   String password = Encryption.getEncryptedProperty(Environment.PROP_DB_PASSWORD, null);
   try {
     DatabaseConnection.testDatabase(driver, url, userName, password, true);
   } catch (Exception e) {
     // no previous database, all good
     return false;
   }
   return true;
 }