📄 emailproperties.java
字号:
/*
*
* Copyright (c) 2004 SourceTap - www.sourcetap.com
*
* The contents of this file are subject to the SourceTap Public License
* ("License"); You may not use this file except in compliance with the
* License. You may obtain a copy of the License at http://www.sourcetap.com/license.htm
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
* the specific language governing rights and limitations under the License.
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
*/
package com.sourcetap.sfa.util;
import java.util.HashMap;
import java.util.Map;
import java.util.ResourceBundle;
/**
* Generic Entity - Entity Group Definition Reader
*
* @author <a href="mailto:jonesde@ofbiz.org">David E. Jones</a>
* @created May 15, 2001
* @version 1.0
*/
public class EmailProperties {
private static EmailProperties emailProperties_ = null;
public static final String SFA_PROPERTIES_FILE = "sfa";
public Map emailPropertiesTable = new HashMap();
public String relayHost = "localhost";
public boolean smtpDebug = false;
public String notifyLink = "http://localhost:8080/sfa/control/leadDetail?action=show&leadId=";
public boolean sendEmail = true;
public String sendEmailFrom = "admin@sourcetap.com";
public boolean sendSMS = true;
public String sendSMSFrom = "admin@sourcetap.com";
public EmailProperties() {
ResourceBundle res = ResourceBundle.getBundle(SFA_PROPERTIES_FILE);
if (res != null) {
try {
String value = res.getString("smtp.relay.host");
if (value != null) {
relayHost = value;
}
} catch (Exception e) {
}
try {
String value = res.getString("lead.notify.link.url");
if (value != null) {
notifyLink = value;
}
} catch (Exception e) {
}
try {
String value = res.getString("lead.notify.email.from");
if (value != null) {
sendEmailFrom = value;
}
} catch (Exception e) {
}
try {
String value = res.getString("lead.notify.sms.from");
if (value != null) {
sendSMSFrom = value;
}
} catch (Exception e) {
}
try {
String value = res.getString("lead.notify.smtp.debug");
if (value != null) {
smtpDebug = "true".equals(value);
}
} catch (Exception e) {
}
try {
String value = res.getString("lead.notify.email.send");
if (value != null) {
sendEmail = "true".equals(value);
}
} catch (Exception e) {
}
try {
String value = res.getString("lead.notify.sms.send");
if (value != null) {
sendSMS = "true".equals(value);
}
} catch (Exception e) {
}
}
}
/**
* DOCUMENT ME!
*
* @return
*/
public static EmailProperties getInstance() {
if (emailProperties_ == null) {
synchronized (EmailProperties.class) {
if (emailProperties_ == null) {
emailProperties_ = new EmailProperties();
}
}
}
return emailProperties_;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -