mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
change paths
This commit is contained in:
@@ -4,13 +4,15 @@ import cn.hutool.core.io.IORuntimeException;
|
||||
|
||||
/**
|
||||
* 全局邮件帐户,依赖于邮件配置文件{@link MailAccount#MAIL_SETTING_PATHS}
|
||||
*
|
||||
*
|
||||
* @author looly
|
||||
*
|
||||
*/
|
||||
public enum GlobalMailAccount {
|
||||
INSTANCE;
|
||||
|
||||
private static final String[] MAIL_SETTING_PATHS = new String[]{"config/mail.setting", "config/mailAccount.setting", "mail.setting"};
|
||||
|
||||
private final MailAccount mailAccount;
|
||||
|
||||
/**
|
||||
@@ -22,7 +24,7 @@ public enum GlobalMailAccount {
|
||||
|
||||
/**
|
||||
* 获得邮件帐户
|
||||
*
|
||||
*
|
||||
* @return 邮件帐户
|
||||
*/
|
||||
public MailAccount getAccount() {
|
||||
@@ -31,11 +33,11 @@ public enum GlobalMailAccount {
|
||||
|
||||
/**
|
||||
* 创建默认帐户
|
||||
*
|
||||
*
|
||||
* @return MailAccount
|
||||
*/
|
||||
private MailAccount createDefaultAccount() {
|
||||
for (String mailSettingPath : MailAccount.MAIL_SETTING_PATHS) {
|
||||
for (String mailSettingPath : MAIL_SETTING_PATHS) {
|
||||
try {
|
||||
return new MailAccount(mailSettingPath);
|
||||
} catch (IORuntimeException ignore) {
|
||||
|
@@ -37,6 +37,10 @@ public class MailAccount implements Serializable {
|
||||
private static final String MAIL_DEBUG = "mail.debug";
|
||||
private static final String SPLIT_LONG_PARAMS = "mail.mime.splitlongparameters";
|
||||
|
||||
/**
|
||||
* @deprecated 此公共配置没有公开必要,迁移至GlobalMailAccount#MAIL_SETTING_PATHS
|
||||
*/
|
||||
@Deprecated
|
||||
public static final String[] MAIL_SETTING_PATHS = new String[]{"config/mail.setting", "config/mailAccount.setting", "mail.setting"};
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user