public void setMailProperties(Properties mailProperties) throws Exception { this.mailProperties = mailProperties; Set<String> propertyNames = mailProperties.stringPropertyNames(); for(String propName : propertyNames) { try { if( "upload.approval.url".equals(propName) ) { approvalPageLink = mailProperties.getProperty(propName); logger.info("approvalPageLink: "+approvalPageLink); } else if( "upload.sendNotification".equals(propName) ) { sendUploadMailNotification = Boolean.parseBoolean( mailProperties.getProperty(propName) ); logger.info("sendUploadMailNotification: "+sendUploadMailNotification); } else if( "upload.sender".equals(propName) ) { String value = mailProperties.getProperty(propName); MailRecipient r = MailRecipient.parseString(value); fromAddress = r; } } catch(Exception e) { throw new Exception("Problem while parsing key: "+propName, e); } } }
public void parseMailProperties(Properties mailProperties) throws Exception { Set<String> propertyNames = mailProperties.stringPropertyNames(); for(String propName : propertyNames) { try { if( "upload.sendNotification".equals(propName) ) { sendUploadMailNotification = Boolean.parseBoolean( mailProperties.getProperty(propName) ); logger.info("sendUploadMailNotification: "+sendUploadMailNotification); } else if( "upload.sender".equals(propName) ) { String value = mailProperties.getProperty(propName); MailRecipient r = MailRecipient.parseString(value); fromAddress = r; } else if( "upload.submission.url".equals(propName) ) { submissionPageLink = mailProperties.getProperty(propName); logger.info("Submission Page URL: "+submissionPageLink); } } catch(Exception e) { throw new Exception("Problem while parsing key: "+propName, e); } } }
public void setMailProperties(Properties mailProperties) throws Exception { this.mailProperties = mailProperties; Set<String> propertyNames = mailProperties.stringPropertyNames(); for(String propName : propertyNames) { try { if( "upload.sender".equals(propName) ) { String value = mailProperties.getProperty(propName); MailRecipient r = MailRecipient.parseString(value); fromAddress = r.getInternetAddress(); } else if( "user.sender".equals(propName) ) { String value = mailProperties.getProperty(propName); MailRecipient r = MailRecipient.parseString(value); fromAddress = r.getInternetAddress(); } } catch(Exception e) { throw new Exception("Problem while parsing key: "+propName, e); } } }
fromAddress = MailRecipient.parseString(value);