?? util.java
字號:
/*
* 創建日期 2005-10-25
*
* TODO 要更改此生成的文件的模板,請轉至
* 窗口 - 首選項 - Java - 代碼樣式 - 代碼模板
*/
package javazip.util;
import java.io.File;
/**
* @author dragon
*
* TODO 要更改此生成的類型注釋的模板,請轉至 窗口 - 首選項 - Java - 代碼樣式 - 代碼模板
*/
public class Util {
CompressUtil util;
public final int ZIP = 1;
public final int GZIP = 2;
public final int JAR = 3;
private String comment;
public int curType = ZIP;
/**
*
* @param list
* @param target
*/
public void compressFile(File list[], String target) {
if (curType == ZIP) {
ZipUtil util = new ZipUtil();
util.setComment(comment);
util.compressFile(list, target);
} else if (curType == GZIP) {
util = new GzipUtil();
util.compressFile(list, target);
} else if (curType == JAR) {
util = new JarUtil();
util.compressFile(list, target);
} else {
util = new ZipUtil();
util.compressFile(list, target);
}
}
/**
*
* @param source
* @param target
*/
public void extractFile(String source, String target) {
if (source.endsWith(".zip")) {
ZipUtil util = new ZipUtil();
util.extractFile(source, target);
} else if (source.endsWith(".gz")) {
util = new GzipUtil();
util.extractFile(source, target);
} else if (source.endsWith(".jar")) {
util = new JarUtil();
util.extractFile(source, target);
} else {
}
}
/**
*
* @param f
* @return
*/
public boolean testFile(File f) {
String source = f.toString();
if (source.endsWith(".zip")) {
util = new ZipUtil();
return util.testFile(f);
} else if (source.endsWith(".gz")) {
util = new GzipUtil();
return util.testFile(f);
} else if (source.endsWith(".jar")) {
util = new JarUtil();
return util.testFile(f);
} else {
}
return true;
}
/**
*
* @return
*/
public String getComment() {
return comment;
}
/**
*
* @param comment
*/
public void setComment(String comment) {
this.comment = comment;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -