📄 beansconstants.java
字号:
package fengyun.Fastmail.beans;
import java.io.File;
import java.io.FileInputStream;
import java.util.Properties;
//Webmail配置信息
public class BeansConstants {
private static boolean load = false;
private BeansConstants() {}
private static BeansConstants bc = new BeansConstants();
public static BeansConstants getInstance() {
if (!load) load();
return bc;
}
public static void load() {
Properties prop = new Properties();
File file = new File("/www/htdocs/WEB-INF/Fastmail.properties");
try {
prop.load(new FileInputStream(file));
}
catch(Exception e) {
e.printStackTrace();
return;
}
String strTemp = null;
if ((strTemp = prop.getProperty("revname")) != null) {
revname = strTemp;
}
else {
revname = "收件箱";
}
if ((strTemp = prop.getProperty("sntname")) != null) {
sntname = strTemp;
}
else {
sntname = "发件箱";
}
if ((strTemp = prop.getProperty("srcname")) != null) {
srcname = strTemp;
}
else {
srcname = "草稿箱";
}
if ((strTemp = prop.getProperty("dsbname")) != null) {
dsbname = strTemp;
}
else {
dsbname = "垃圾箱";
}
if ((strTemp = prop.getProperty("mysql")) != null) {
dburl = strTemp;
}
if ((strTemp = prop.getProperty("mailhost")) != null) {
mailhost = strTemp;
}
else {
mailhost = "localhost";
}
if ((strTemp = prop.getProperty("smtphost")) != null) {
smtphost = strTemp;
}
else {
smtphost = "localhost";
}
if ((strTemp = prop.getProperty("defaultdomain")) != null) {
domain = strTemp;
}
if ((strTemp = prop.getProperty("defaultcharset")) != null) {
DefaultCharSet = strTemp;
}
else {
DefaultCharSet = "ISO-8859-1";
}
if ((strTemp = prop.getProperty("userhome")) != null) {
userhome = strTemp;
}
else {
userhome = "/home/mail";
}
if ((strTemp = prop.getProperty("attachmentpool")) != null) {
attachmentpool = strTemp;
}
else {
attachmentpool = "/home/attachment";
}
if ((strTemp = prop.getProperty("attachmaxsize")) != null) {
attachmaxsize = Integer.parseInt(strTemp);
}
else {
attachmaxsize = 1024 * 1024;
}
if ((strTemp = prop.getProperty("defaultpagesize")) != null) {
DefaultPageSize = Integer.parseInt(strTemp);
}
else {
DefaultPageSize = 15;
}
if ((strTemp = prop.getProperty("webmastermail")) != null) {
webmastermail = strTemp;
}
else {
webmastermail = "fengyun@gbsource.net";
}
if ((strTemp = prop.getProperty("webmastermail")) != null) {
webmastermail = strTemp;
}
else {
webmastermail = "fengyun@gbsource.net";
}
if((strTemp = prop.getProperty("debug")) != null) {
debug = (new Boolean(strTemp)).booleanValue();
}
else {
debug = false;
}
strTemp = null;
load = true;
}
public static final String userid = "userid"; //用户ID
public static final String passwd = "passwd"; //用户密码
public static final String dbuserid = "userid"; //DBUserid
public static final String dbpasswd = "password"; //DB密码
public static final String dbhome = "home"; //DBHome
public static final String username = "username"; //用户姓名
public static final String gender = "gender"; //性别
public static final String confirm = "confirm"; //密码确认
public static final String location = "location"; //来自
public static final String zipcode = "zipcode"; //邮编
public static final String phone = "phone"; //电话号码
public static final String birthYear = "year"; //出生年份
public static final String birthMonth = "month"; //出生月份
public static final String birthDay = "day"; //出生日期
public static final String occupation = "occupation"; //职业
public static final String education = "education"; //教育程度
public static final String province = "province"; //省份
public static final String cardNumber = "cardNumber"; //身份证号码或学号
public static final String certificateType = "certificateType"; //证件类型
public static final String FastmailUserid = "Userid"; //Session变量名Usreid
public static final String FastmailStore = "Store"; //Session变量名Store
public static final String FastmailFolderView = "FolderView"; //Session变量名FolderView
public static final String FastmailMsgList = "MsgList"; //Session变量名MessageList
public static final String FastmailMysql = "Mysql"; //Session变量名Mysql
public static final String FastmailAddress = "Address"; //Session变量名Address
public static final String FastmailAttach = "aVector"; //Session变量名Attach
public static final String FastmailCurrentFolder = "curFolder"; //Session变量名Attach
public static final String folderid = "folderid"; //Request参数名
public static final String foldername = "foldername"; //Request参数名
public static final String folderto = "folderto"; //Request参数名
public static final String messageid = "msgid"; //Request参数名
public static final String messagelist = "msglist"; //Request参数名
public static final String page = "page"; //Request参数名
public static final String to = "to"; //Request参数名
public static final String from = "from"; //Request参数名
public static final String cc = "cc"; //Request参数名
public static final String bcc = "bcc"; //Request参数名
public static final String subject = "subject"; //Request参数名
public static final String body = "body"; //Request参数名
public static final String attach = "attach"; //Request参数名
public static final String index = "index"; //Request参数名
public static final String next = "next"; //Request参数名
public static final String action = "action"; //Request参数名
public static final String form = "form"; //Request参数名
public static final String delete = "delete"; //Request参数名
public static final String realdelete = "realdel"; //Request参数名
public static final String send = "send"; //Request参数名
public static final String reply = "reply"; //Request参数名
public static final String replyall = "reall"; //Request参数名
public static final String forward = "forward"; //Request参数名
public static final String save = "save"; //Request参数名
public static final String move = "move"; //Request参数名
public static final String upload = "upload"; //Request参数名
public static final String pop = "pop"; //Request参数名
public static final String compose = "compose"; //Request参数名
public static final String address = "address"; //Request参数名
public static final String create = "create"; //Request参数名
public static final String wordreply = "回复:"; //附加信息
public static final String wordforward = "转发:"; //附加信息
public static final String wordattach = "附件:"; //附加信息
public static final String separator = File.separator; //文件分隔符
public static final String dateformat = "yyyy年MM月dd日"; //日期类型
public static final String timeformat = "yyyy年MM月dd日 hh时mm分ss秒"; //时间格式
public static final String entimeformat = "yyyy.MM.dd hh:mm:ss"; //时间格式
public static final String dbdriver = "org.gjt.mm.mysql.Driver"; //数据库JDBC驱动程序名称
public static String dburl =
"jdbc:mysql://202.112.14.101:3306/fastmail?user=root&password=ffqq1188"; //数据库连接URL
public static final String maildir = "Maildir"; //Maildir默认目录
public static String mailhost = "localhost"; //邮件收取服务器(IMAP)
public static String smtphost = "localhost"; //邮件发送服务器(SMTP)
public static String domain = "fastmail.uestc.edu.cn"; //邮件地址域名
public static final String protocol = "Maildir"; //邮件收取协议
public static final String mailerkey = "X-Mailer"; //发送程序键值
public static final String mailer = "FastMail 1.0"; //邮件发送程序名称
public static String DefaultCharSet = "ISO-8859-1";
public static final String root = ""; //根文件夹路径(一般为空,但Courier-IMAP Server要求必须为INBOX)
public static String userhome = "/home/mail"; //存放用户主目录的根目录
public static String attachmentpool = "/home/attachment"; //附件缓冲池
public static String webmastermail = "fengyun@gbsource.net"; //管理者信箱
public static boolean debug = false;
public static int attachmaxsize = 1024 * 1024; //附件最大尺寸
public static final int maxlevel = 5; //邮件夹最大层数
public static final int maxspread = 100; //邮件夹分布目录数
public static final int revbox = 10000; //收件箱索引
public static final int sntbox = 20000; //发件箱索引
public static final int srcbox = 30000; //原稿箱索引
public static final int dsbbox = 40000; //垃圾箱索引
public static final String rev = "rev"; //收件箱
public static final String snt = "snt"; //发件箱
public static final String src = "src"; //原稿箱
public static final String dsb = "dsb"; //垃圾箱
public static String revname = "收件箱"; //收件箱
public static String sntname = "发件箱"; //发件箱
public static String srcname = "草稿箱"; //原稿箱
public static String dsbname = "垃圾箱"; //垃圾箱
public static int DefaultPageSize = 15; //默认单页消息数
//错误参数号
public static final int OK = 0; //状态名
public static final int PARAM_ERROR = 1; //参数错误
public static final int NONESELECTED = 34; //未选中任何一项
public static final int MAILTO_ERROR = 35; //Mailto
public static final int ADDRESS_ERROR = 36; //地址解析错误
public static final int ATTACHSIZE_BIG = 37; //附件超大
public static final int ATTACHDEL_ERROR = 38; //附件删除错误
public static final int ATTACHNONE_ERROR = 39; //没有错误
public static final int SQL_ERROR = 51; //数据库错误
public static final int PASS_ERROR = 52; //密码或用户名错误
public static final int DRIVER_ERROR = 53; //数据库引擎错误
public static final int CHMODERROR = 71;
public static final int MAILDIREXISTS = 72;
public static final int CANTCREATEFOLD = 73;
public static final int CANTDELETEFOLD = 74;
public static final int MAILBOXFULL = 75; //信箱已满
public static final int HTTPREQUEST_ERROR = 81; //HTTPREQUEST
public static final int HTTPSESSION_ERROR = 86; //HTTPSESSION
public static final int FOLDERID_ERROR = 91; //邮件夹ID错误
public static final int FOLDERGET_ERROR = 92; //邮件夹获取错误
public static final int MSGID_ERROR = 101; //消息名参数错误
public static final int MSGCREATE_ERROR = 108; //消息建立错误
public static final int MSGSAVE_ERROR = 109; //消息保存错误
public static final int MSGSEND_ERROR = 110; //消息发送错误
public static final int MSGREAD_ERROR = 111; //消息读取错误
public static final int MSG_ERROR = 112; //消息读取错误
public static final int MSGDUMP_ERROR = 113; //消息读取错误
public static final int USERID_EXISTS = 120; //用户存在
public static final int CONFIRM_ERROR = 121; //密码检查错误
public static final int FORM_ERROR = 122; //没有填写
public static final int IDCARD_ERROR = 123; //身份证检查错误
public static final int STUDENT_ERROR = 124; //学生证检查填写
public static final int IO_ERROR = 201; //读写错误
public static final int UNEXPECTED = -1; //未知错误
public static final String[] provinces = {"请选...","北京","广东","广西","海南","福建","天津","湖南","湖北","河南","河北","山东","山西","黑龙江","辽宁","上海","甘肃","青海","新疆","西藏","宁夏","四川","云南","吉林","内蒙古","陕西","安徽","贵州","江苏","重庆","浙江","江西"};
public static final String[] educations = {"请选...","高中以下程度","高中/中专","大学/专科","大学以上"};
public static final String[] occupations = {"请选...","教育/研究","艺术/设计","法律相关行业","行政管理","传播/媒体","顾问/分析员","服务/后勤","工程师","金融/财会","政府机关/团体","人力资源及训练","管理阶层","业务/广告","项目/产品经理","退休","营销/中介","秘书/行政助理","自由职业","学生","其他行业"};
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -