public class Aaaa {
public static void main(String[] args) throws Exception {
try {
//可以在zip文件中嵌套zip文件。下面最后生成outer.zip文件。
FileOutputStream fos = new FileOutputStream("outer.zip/inner.zip/output.txt");
PrintStream ps = new PrintStream(fos);
ps.println("Creating nested ZIP files is really a no-brainer!");
ps.println(2323);
fos.close();
ps.close();
}
catch (Exception e) {
e.printStackTrace();
}
finally {
File.update();
}
.You need to use an additional API (the package java.util.zip) if your application needs to support ZIP compatible files in addition to ordinary files and directories, thereby significantly inflating your code and adding unnecessary complexity (which adds bugs, bugs, and even more bugs).
.You can either read or completely write ZIP compatible files, but you cannot just update individual entries.
.The classes do not support the concept of a directory, which you may want to create, modify, list or delete.
The TrueZIP Library has been developed to overcome these limitations/disadvantages.