摘要: 1、DOM4J简介 DOM4J是 dom4j.org 出品的一个开源 XML 解析包。DOM4J应用于 Java 平台,采用了 Java 集合框架并完全支持 DOM,SAX 和JAXP。 DOM4J使用起来非常简单。只要你了解基本的 XML-DOM 模型,就能使用。 Dom:把整个文档作为一个对象。 阅读全文
posted @ 2015-02-04 22:17 沧海一滴 阅读(698) 评论(0) 推荐(0) 编辑
摘要: public class Singleton { /** * 类级的内部类,也就是静态的成员式内部类,该内部类的实例与外部类的实例 * 没有绑定关系,而且只有被调用到才会装载,从而实现了延迟加载 */ private static class SingletonH... 阅读全文
posted @ 2015-02-04 22:11 沧海一滴 阅读(1359) 评论(0) 推荐(0) 编辑
摘要: 以前我一直以为File#renameTo(File)方法与OS下面的 move/mv 命令是相同的,可以达到改名、移动文件的目的。不过后来经常发现问题:File#renameTo(File)方法会返回失败(false),文件没有移动,又查不出原因,再后来干脆弃用该方法,自己实现一个copy方法,问题 阅读全文
posted @ 2015-02-04 18:59 沧海一滴 阅读(5441) 评论(3) 推荐(0) 编辑
摘要: I created a copy of the tar archive and copied to entire content to it. Then I delete the old tar archive.public void appendFileInTarArchive(String ta... 阅读全文
posted @ 2015-02-04 18:48 沧海一滴 阅读(540) 评论(0) 推荐(0) 编辑
摘要: include my own version for your reference. We use this one to zip up photos to download so it works with various unzip programs. It preserves the dire... 阅读全文
posted @ 2015-02-04 18:46 沧海一滴 阅读(312) 评论(0) 推荐(0) 编辑
摘要: Creating a zip file is a task that can easily be accomplished by using the classes ZipOutputStream and ZipEntry in the java.util.zip package.First of ... 阅读全文
posted @ 2015-02-04 18:35 沧海一滴 阅读(343) 评论(0) 推荐(0) 编辑
摘要: ZIP and TAR fomats (and the old AR format) allow file append without a full rewrite. However:The Java archive classes DO NOT support this mode of oper... 阅读全文
posted @ 2015-02-04 15:18 沧海一滴 阅读(1923) 评论(0) 推荐(0) 编辑