* @param request
* current request
*/
private void storeSettings(MailSettings cfg, ProcessingContext jParams,
HttpServletRequest request) throws IOException, ServletException {
SettingsBean settings = SettingsBean.getInstance();
// set new values in the properties manager...
PropertiesManager properties = new PropertiesManager(JahiaContextLoaderListener.getServletContext().getRealPath(SettingsBean.JAHIA_PROPERTIES_FILE_PATH));
properties.setProperty("mail_service_activated", cfg.isServiceActivated() ? "true" : "false");
properties.setProperty("mail_server", cfg.getHost());
properties.setProperty("mail_administrator", cfg.getTo());
properties.setProperty("mail_from", cfg.getFrom());
properties.setProperty("mail_paranoia", cfg.getNotificationLevel());
// write in the jahia properties file...
properties.storeProperties();
settings.setMail_service_activated(cfg.isServiceActivated());
settings.setMail_server(cfg.getHost());
settings.setMail_administrator(cfg.getTo());
settings.setMail_from(cfg.getFrom());
settings.setMail_paranoia(cfg.getNotificationLevel());
// restart the mail service
MailService mailSrv = ServicesRegistry.getInstance().getMailService();
try {
mailSrv.stop();