一个java解压文件的递归调用 急

下面是接压单个压缩文件的代码,那请问,如果我压缩文件里面还有压缩文件怎么递归调用全部接压呢?接压后应按照接压前的包路径一致。须急用,请指教
[code="java"]
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.util.ArrayList;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;

public class ZipToFile {
/**
* 将文件解压缩
* @param sZipPathFile 需要解压的文件
* @param sDestPath 解压后的文件路径
* @return
*/
public static boolean zipToFile(String sZipPathFile, String sDestPath) {
boolean flag = false;
ArrayList allFileName = new ArrayList();
try {
// 先指定压缩档的位置和档名,建立FileInputStream对象
FileInputStream fins = new FileInputStream(sZipPathFile);
// 将fins传入ZipInputStream中
ZipInputStream zins = new ZipInputStream(fins);
ZipEntry ze = null;
byte ch[] = new byte[256];
while ((ze = zins.getNextEntry()) != null) {
File zfile = new File(sDestPath + ze.getName());
File fpath = new File(zfile.getParentFile().getPath());
if (ze.isDirectory()) {
if (!zfile.exists())
zfile.mkdirs();
zins.closeEntry();
} else {
if (!fpath.exists())
fpath.mkdirs();
FileOutputStream fouts = new FileOutputStream(zfile);
int i;
allFileName.add(zfile.getAbsolutePath());
while ((i = zins.read(ch)) != -1)
fouts.write(ch, 0, i);
zins.closeEntry();
fouts.close();
}
}
fins.close();
zins.close();
flag = true;
} catch (Exception e) {
System.err.println("Extract error:" + e.getMessage());
}
return flag;
}

public static void main(String[] args){
    String sZipPathFile = "c:/test.zip";
    String sDestPath = "c:/";
    ZipToFile.zipToFile(sZipPathFile, sDestPath);//将c盘下的test.zip文件解压到c盘下
}

}

[/code]

[code="java"]package test;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.util.ArrayList;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;

public class ZipToFile {

public static boolean zipToFile(String sZipPathFile, String sDestPath) {
    boolean flag = false;
    try {

        FileInputStream fins = new FileInputStream(sZipPathFile);

        ZipInputStream zins = new ZipInputStream(fins);
        ZipEntry ze = null;
        byte ch[] = new byte[256];
        while ((ze = zins.getNextEntry()) != null) {
            File zfile = new File(sDestPath + "//" + ze.getName());
            File fpath = new File(zfile.getParentFile().getPath());
            if (ze.isDirectory()) {
                if (!zfile.exists())
                    zfile.mkdirs();
                zins.closeEntry();
            } else {
                if (!fpath.exists())
                    fpath.mkdirs();
                FileOutputStream fouts = new FileOutputStream(zfile);
                int i;
                String zfilePath = zfile.getAbsolutePath();
                while ((i = zins.read(ch)) != -1)
                    fouts.write(ch, 0, i);
                zins.closeEntry();
                fouts.close();

                if (zfilePath.endsWith(".zip")) {
                    zipToFile(zfilePath, zfilePath.substring(0, zfilePath
                            .lastIndexOf(".zip")));
                }

            }
        }
        fins.close();
        zins.close();

        // if necessary, delete original zip-file
        File file = new File(sZipPathFile);

        file.delete();
        flag = true;
    } catch (Exception e) {
        System.err.println("Extract error:" + e.getMessage());
    }
    return flag;
}

public static void main(String[] args) {
    String sZipPathFile = "C:/Music.zip";
    String sDestPath = "C:/";
    ZipToFile.zipToFile(sZipPathFile, sDestPath);
}

}[/code]

1.[code="java"]File zfile = new File(sDestPath + ze.getName()); [/code]
应改为:
[code="java"]File zfile = new File(sDestPath + "//" + ze.getName());[/code]

2.如果解压出来的不是目录,而是文件,则
[code="java"]if (zfilePath.endsWith(".zip")) {
zipToFile(zfilePath, zfilePath.substring(0, zfilePath
.lastIndexOf(".zip")));
}[/code]

3.如果有需要,在fins.close()和zins.close()后,删除zip文件:
[code="java"]// if necessary, delete original zip-file
File file = new File(sZipPathFile);

        file.delete();[/code]