- 浏览: 676688 次
- 性别:
- 来自: 上海
文章分类
- 全部博客 (254)
- java分布式应用架构 (22)
- SSH框架整合 (6)
- java web 学习笔记 (49)
- java 学习笔记 (56)
- struts 2 学习 (6)
- Hibernate学习 (10)
- spring 学习 (2)
- 客户端编程(javascript) (4)
- IDE使用 (13)
- 生命 人生 (6)
- 系统维护 (3)
- 技术篇 (10)
- MySql (2)
- J2ME (1)
- java网络编程 (4)
- 数据库 (5)
- C/C++ (8)
- Oracle (7)
- 软件测试 (0)
- 软件的安装和部署 (0)
- Java快讯 (1)
- swt (1)
- Flex (1)
- 软件工程 (1)
- PostgreSQL (1)
- sql server2000 (2)
- 嵌入式数据库sqlite (5)
- J2EE (1)
- XML (1)
- ibatis3(MyBatis) (6)
- Linux&Unix (1)
- velocity (1)
- 回报社会 (4)
- 软件项目管理 (3)
- android研究 (3)
- C# (2)
- Objective-C (1)
- 音乐 (0)
- webx (1)
- JMS (1)
- maven软件项目管理 (1)
- 分布式服务 (0)
- 云平台 (0)
- 分布式存储 (1)
- 分布式系统架构 (0)
- 移动互联网 (1)
- ZooKeeper (1)
最新评论
-
liyys:
楼主,可不可以发这个项目的源码工程出来分享一下,少了几个类。楼 ...
仿照Hibernate实现一个SQLite的ORM框架 -
liyys:
少了一些类的源码没有粘贴出来
仿照Hibernate实现一个SQLite的ORM框架 -
honglei0412:
我使用的是这种方式获取db文件的目录但是 URL p = Fi ...
使用sqlite注意事项 -
honglei0412:
大侠 能不能说明下DbFile您是怎么做的吗?
使用sqlite注意事项 -
ahack:
刚写完mapping才发现早就有人写好了。仔细一看还都是针对的 ...
仿照Hibernate实现一个SQLite的ORM框架
属性文件:
工具类:
#各大邮件服务器地址大全, receive结尾的键代表接收服务器地址, send结尾的键代表发送服务器地址 #网易126邮箱 host.126.receive=pop3.126.com host.126.send=smtp.126.com #网易163免费邮箱 host.163.receive=pop.163.com host.163.send=smtp.163.com #网易163VIP邮箱 host.163.vip.receive=pop.vip.163.com host.163.vip.send=smtp.vip.163.com #网易188财富邮箱 host.188.receive=pop.188.com host.188.send=smtp.188.com #网易yeah.net邮箱 host.yeah.receive=pop.yeah.net host.yeah.send=smtp.yeah.net #网易netease.com邮箱 host.netease.receive=pop.netease.com host.netease.send=smtp.netease.com #新浪收费邮箱 host.sina.vip.receive=pop3.vip.sina.com host.sina.vip.send=smtp.vip.sina.com #新浪免费邮箱 host.sina.receive=pop3.sina.com.cn host.sina.send=smtp.sina.com.cn #搜狐邮箱 host.sohu.receive=pop3.sohu.com host.sohu.send=smtp.sohu.com #21cn快感邮箱 host.21cn.vip.receive=vip.21cn.com host.21cn.vip.send=vip.21cn.com #21cn经济邮箱 host.21cn.receive=pop.21cn.com host.21cn.send=smtp.21cn.com #tom邮箱 host.tom.receive=pop.tom.com host.tom.send=smtp.tom.com #263邮箱 host.263.receive=263.net host.263.send=smtp.263.net #中华网邮箱 host.china.receive=pop.china.com host.china.send=smtp.china.com #雅虎邮箱 host.yahoo.receive=pop.mail.yahoo.com host.yahoo.send=smtp.mail.yahoo.com #Gmail邮箱 host.gmail.receive=pop.gmail.com host.gmail.send=smtp.gmail.com #QQ邮箱 host.qq.receive=pop.qq.com host.qq.send=smtp.qq.com
工具类:
package org.liufei.email; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.net.MalformedURLException; import java.net.URL; import java.util.Properties; import java.util.logging.Level; import java.util.logging.Logger; /** * 从属性文件中读取邮件服务器地址 * * @author 刘飞 * */ public final class MailHost { private static Logger logger = Logger.getLogger(MailHost.class.getName()); private static final String HOST_CONFIG = "/mailhost.properties"; private static Properties HOST = new Properties(); static { try { HOST.load(ConfigHelper.getResourceAsStream(HOST_CONFIG)); if (HOST == null) HOST = ConfigHelper.getConfigProperties(HOST_CONFIG); } catch (FileNotFoundException e) { logger.log(Level.WARNING, e.getLocalizedMessage()); } catch (IOException e) { logger.log(Level.WARNING, e.getLocalizedMessage()); } } private static String get(String key) { return HOST.getProperty(key, ""); } private static final String host_126_receive = "host.126.receive"; private static final String host_126_send = "host.126.send"; public static String get126ReceiveHost() { return get(host_126_receive); } public static String get126SendHost() { return get(host_126_send); } private static final String host_163_receive = "host.163.receive"; private static final String host_163_send = "host.163.send"; public static String get163ReceiveHost() { return get(host_163_receive); } public static String get163SendHost() { return get(host_163_send); } private static final String host_163_vip_receive = "host.163.vip.receive"; private static final String host_163_vip_send = "host.163.vip.send"; public static String get163VipReceiveHost() { return get(host_163_vip_receive); } public static String get163VipSendHost() { return get(host_163_vip_send); } private static final String host_188_receive = "host.188.receive"; private static final String host_188_send = "host.188.send"; public static String get188ReceiveHost() { return get(host_188_receive); } public static String get188SendHost() { return get(host_188_send); } private static final String host_yeah_receive = "host.yeah.receive"; private static final String host_yeah_send = "host.yeah.send"; public static String getYeahReceiveHost() { return get(host_yeah_receive); } public static String getYeahSendHost() { return get(host_yeah_send); } private static final String host_netease_receive = "host.netease.receive"; private static final String host_netease_send = "host.netease.send"; public static String getNeteaseReceiveHost() { return get(host_netease_receive); } public static String getNeteaseSendHost() { return get(host_netease_send); } private static final String host_sina_vip_receive = "host.sina.vip.receive"; private static final String host_sina_vip_send = "host.sina.vip.send"; public static String getSinaVipReceiveHost() { return get(host_sina_vip_receive); } public static String getSinaVipSendHost() { return get(host_sina_vip_send); } private static final String host_sina_receive = "host.sina.receive"; private static final String host_sina_send = "host.sina.send"; public static String getSinaReceiveHost() { return get(host_sina_receive); } public static String getSinaSendHost() { return get(host_sina_send); } private static final String host_sohu_receive = "host.sohu.receive"; private static final String host_sohu_send = "host.sohu.send"; public static String getSohuReceiveHost() { return get(host_sohu_receive); } public static String getSohuSendHost() { return get(host_sohu_send); } private static final String host_21cn_vip_receive = "host.21cn.vip.receive"; private static final String host_21cn_vip_send = "host.21cn.vip.send"; public static String get21cnVipReceiveHost() { return get(host_21cn_vip_receive); } public static String get21cnVipSendHost() { return get(host_21cn_vip_send); } private static final String host_21cn_receive = "host.21cn.receive"; private static final String host_21cn_send = "host.21cn.send"; public static String get21cnReceiveHost() { return get(host_21cn_receive); } public static String get21cnSendHost() { return get(host_21cn_send); } private static final String host_tom_receive = "host.tom.receive"; private static final String host_tom_send = "host.tom.send"; public static String getTomReceiveHost() { return get(host_tom_receive); } public static String getTomSendHost() { return get(host_tom_send); } private static final String host_263_receive = "host.263.receive"; private static final String host_263_send = "host.263.send"; public static String get263ReceiveHost() { return get(host_263_receive); } public static String get263SendHost() { return get(host_263_send); } private static final String host_china_receive = "host.china.receive"; private static final String host_china_send = "host.china.send"; public static String getChinaReceiveHost() { return get(host_china_receive); } public static String getChinaSendHost() { return get(host_china_send); } private static final String host_yahoo_receive = "host.yahoo.receive"; private static final String host_yahoo_send = "host.yahoo.send"; public static String getYahooReceiveHost() { return get(host_yahoo_receive); } public static String getYahooSendHost() { return get(host_yahoo_send); } private static final String host_gmail_receive = "host.gmail.receive"; private static final String host_gmail_send = "host.gmail.send"; public static String getGmailReceiveHost() { return get(host_gmail_receive); } public static String getGmailSendHost() { return get(host_gmail_send); } private static final String host_qq_receive = "host.qq.receive"; private static final String host_qq_send = "host.qq.send"; public static String getQQReceiveHost() { return get(host_qq_receive); } public static String getQQSendHost() { return get(host_qq_send); } private MailHost() { } private static final class ConfigHelper { private static final Logger log = Logger.getLogger(ConfigHelper.class .getName()); public static final URL locateConfig(final String path) { try { return new URL(path); } catch (MalformedURLException e) { return findAsResource(path); } } public static final URL findAsResource(final String path) { URL url = null; ClassLoader contextClassLoader = Thread.currentThread() .getContextClassLoader(); if (contextClassLoader != null) { url = contextClassLoader.getResource(path); } if (url != null) return url; url = ConfigHelper.class.getClassLoader().getResource(path); if (url != null) return url; url = ClassLoader.getSystemClassLoader().getResource(path); return url; } public static final InputStream getConfigStream(final String path) throws IOException { final URL url = ConfigHelper.locateConfig(path); if (url == null) { String msg = "Unable to locate config file: " + path; log.log(Level.WARNING, msg); } try { return url.openStream(); } catch (IOException e) { throw e; } } public static final Reader getConfigStreamReader(final String path) throws IOException { return new InputStreamReader(getConfigStream(path)); } public static final Properties getConfigProperties(String path) throws IOException { try { Properties properties = new Properties(); properties.load(getConfigStream(path)); return properties; } catch (IOException e) { throw e; } } private ConfigHelper() { } public static InputStream getResourceAsStream(String resource) { String stripped = resource.startsWith("/") ? resource.substring(1) : resource; InputStream stream = null; ClassLoader classLoader = Thread.currentThread() .getContextClassLoader(); if (classLoader != null) { stream = classLoader.getResourceAsStream(stripped); } if (stream == null) { stream = MailHost.class.getResourceAsStream(resource); } if (stream == null) { stream = MailHost.class.getClassLoader().getResourceAsStream( stripped); } if (stream == null) { log.log(Level.WARNING, resource + " not found"); } return stream; } public static InputStream getUserResourceAsStream(String resource) { boolean hasLeadingSlash = resource.startsWith("/"); String stripped = hasLeadingSlash ? resource.substring(1) : resource; InputStream stream = null; ClassLoader classLoader = Thread.currentThread() .getContextClassLoader(); if (classLoader != null) { stream = classLoader.getResourceAsStream(resource); if (stream == null && hasLeadingSlash) { stream = classLoader.getResourceAsStream(stripped); } } if (stream == null) { stream = MailHost.class.getClassLoader().getResourceAsStream( resource); } if (stream == null && hasLeadingSlash) { stream = MailHost.class.getClassLoader().getResourceAsStream( stripped); } if (stream == null) { log.log(Level.WARNING, resource + " not found"); } return stream; } } }
相关推荐
import java.util.List; import java.util.ArrayList; import java.util.Date; import java.util.Iterator; import java.util.Properties; import javax.mail.Session; import javax.mail.Transport; import javax....
提供了很丰富的java工具类,包括字符串、数字、日期、文件、图像、编码解码、校验工具、文档操作等。 主要分为以下几种: - 1.通用操作类,例如String、数字、日期、各种校验等 - 2.文档操作,excel、pdf等 - 3.加密...
此工具类是工作5年之久的大佬发给我的。工具类涉及数据库连接、格式转换、文件操作、发送邮件等等。提高开发效率,欢迎收藏
工具类里面有关于java bean 转map map转Javabean 可以支持日期类型转换。关于发邮件可见附件工具类,验证码工具类 编码过滤工具类 加密解密工具类,用c3po连接数据库的
java代码-java邮件工具类代码合集 ——学习参考资料:仅用于个人学习使用!
该工具类可直接复制代码,进行调用 在我们的实际开发当中,一封邮件既可能包含图片,又可能包含有附件,在这样的情况下,RFC882文档规定的邮件格式就无法满足要求了。 MIME协议是对RFC822文档的升级和补充,它...
工作5年精心整理_Java常用工具类源码 收集了java项目开中常用的工具操作类,方法非常全,可应用在大部份java 项目中。 提供了很丰富的java工具类,包括字符串、数字、日期、文件、图像、编码解码、校验工具、文档...
工具类中包括,地址解析工具,日期操作工具,邮件工具,json工具,sql工具等等。
在日常的开发过程中,进行邮件发送的情况有很多,现在写了一个工具类发送邮件,并且包含邮件内容的样式.
汇总了Java学习开发过程中常用的一些工具类,如字符串处理的StringUtils,日期处理的DateUtils,生成32位不重复的随机数、文件操作,xml操作,文件上传下载,收发邮件等。
提供了一些Java常用的工具类,工具类涉及数据库连接、格式转换、文件操作、发送邮件等等。方便大家的开发与使用,提高开发效率
java开发,配置邮件客户端参数,可直接调用发送E-mail到指定账号
JAVA语言中发送邮件超详细工具类,填写发送着邮箱信息即可发送。
使用javamail开发的工具类收发邮件
使用springboot开发了一个发送邮件的工具demo,亲测可用,实现类似于邮箱里面发送邮件的功能。支持发送html,图片,文档以及文件等等。 非常适合初学者学习借鉴,代码注释完整丝毫没有压力理解。
2.5.2 系统工具类 74 2.6 系统托盘模块设计 79 2.6.1 系统托盘模块概述 79 2.6.2 系统托盘模块技术分析 79 2.6.3 系统托盘模块实现过程 80 2.7 系统工具模块设计 82 2.7.1 系统工具模块概述 82 2.7.2 系统工具模块...
java工作6年积累常用工具类,可以快速解决日常开发各种问题,涵盖线程、网络、DB、文件、IO流、邮件、Linux远程登录、加密解密、定时任务、XML解析、JOSN解析、CVS和Excel解析、中英文转换等等
第3章 选择开发工具IDE 第2篇 Java语言基础 第4章 Java基本语法 第5章 Java面向对象程序设计(上) 第6章 Java面向对象程序设计(下) 第7章 Java异常处理机制 第8章 Java反射机制 第9章 数据结构与集合类 第3篇 ...
Java二进制IO类与文件复制操作实例,好像是一本书的例子,源代码有的是独立运行的,与同目录下的其它代码文件互不联系,这些代码面向初级、中级Java程序员。 Java访问权限控制源代码 1个目标文件 摘要:Java源码,...