---
title: "light-commons 发布 0.1.0-beta"
author: "jasongreen"
date: "2008-08-06T10:48:15Z"
tags: ["DAO", "Hibernate", "SVN", "commontemplate", "freemarker"]
categories: ["非技术"]
slug: "light-commons-0-1-0-beta"
draft: false
lastmod: "2008-08-06T10:48:15Z"
id: 224907
url: "https://jasongreen.iteye.com/blog/224907"
---

light-commons 的目标是构建一个轻量易用的library。 模块列表： \[b]logger：\[/b] 统一的日志接口，为你自动选择classpath中可用的日志引擎 \[b]util：\[/b] 提供常用的静态方法，如 StringUtils。 \[b]io：\[/b] IOUtils，FileUtils \[b]resource：\[/b] 统一的资源、资源加载器接口 \[b]orm：\[/b] 统一的DaoTemplate，Dao接口，目前只编写了hibernate的实现。 \[b]template：\[/b] 统一的模板接口，目前实现了FreeMarker，CommonTemplate 两种模板引擎。 1. 简化了 io 包，此包中代码来源于commons-io，精简后只保留了IOUtils，FileUtils，另外增加了FastByteArrayOutputStream 2. TemplateFacade 实现了 FreeMarker，Commontemplate 两种引擎。现在你可以简单的使用 TemplateFactory factory = new CommonTemplateFactory() 来构造一个模板工厂。记住，你还需要使用 factory.setResourceLoader(resourceLoader) 来设置模板的装载器。最后使用 factory.getTemplate(...) 即可。 3. 加入了MimeType 枚举类型。 4. 加入了ExProperties 支持非 iso-8859-1 的编码类型。 5. 加入了I18nBundle。 6. StringUtils.cleanPath(String) 工作的更漂亮。 d:\\xx/..//yy/.\\zz -&gt; d:/yy/zz 7. 加入StringUtils.cleanDirPath(String)补充"/"。 d:\\xx/..//yy/.\\zz -&gt; d:/yy/zz/ 相关博客文章： \[url]http://jasongreen.iteye.com/category/34095\[/url] 下载： \[url]http://code.google.com/p/light-commons/downloads/list\[/url] maven2： \[code="xml"] ... light-commons http://light-commons.googlecode.com/svn/repository/ ... org.lightcommons lightcommons 0.1.0-beta \[/code]