package de.duehl.zipwithzip4j.start.direct;

import java.io.File;
import java.io.IOException;

import de.duehl.basics.io.FileHelper;
import net.lingala.zip4j.ZipFile;
import net.lingala.zip4j.exception.ZipException;

public class DirectZipTestZipFolder {

    public static void main(String[] args) {
        String dir = "c:\\temp\\zip4j_test_1";

        String zipFilename = FileHelper.concatPathes(dir, "daten_per_Programm_verpackt.zip");
        String directoryToZip = FileHelper.concatPathes(dir, "daten");
        try (ZipFile zip = new ZipFile(zipFilename)) {
            zip.addFolder(new File(directoryToZip));
        }
        catch (ZipException exception) {
            throw new RuntimeException(exception);
        }
        catch (IOException exception) {
            throw new RuntimeException(exception);
        }
    }

}
