import java.io.IOException;
import utils.myDate;
import utils.myLog;
import de.schlichtherle.truezip.file.TArchiveDetector;
import de.schlichtherle.truezip.file.TFile;
public class Main
{
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Extract(new String("C:/Documents and Settings/mitracomm/My Documents/Downloads/JAR"), new String("D:/Source/Extract Result") , "");
}
private static void Extract(String src, String dst, String incPath)
{
TFile srcFile = new TFile(src + "/" + incPath);
TFile dstFile = new TFile(dst);
try {
TFile.cp_rp(srcFile, dstFile, TArchiveDetector.ALL);
} catch (IOException e) {
myLog.add(myDate.today("yyyyMMdd") + ".log", "error", e.getMessage());
}
}
上記のコードは大きなアーカイブで動作しますか? incPath
また、アーカイブの名前を入力したり指定したりせずに、ディレクトリ内のすべてのアーカイブを抽出するにはどうすればよいですか? これを実行しようとしましたが、抽出されたファイルではなく、元のディレクトリからのすべてのアーカイブのコピーになってしまいます。