@@ -0,0 +1,3754 @@
+package io.github.lonamiwebs.stringlate.utilities;%0A%0Aimport java.io.File;%0Aimport java.io.FileInputStream;%0Aimport java.io.FileOutputStream;%0Aimport java.io.IOException;%0Aimport java.io.InputStream;%0Aimport java.util.Enumeration;%0Aimport java.util.zip.ZipEntry;%0Aimport java.util.zip.ZipFile;%0Aimport java.util.zip.ZipOutputStream;%0A%0Apublic class ZipUtils %7B%0A%0A    //region Constant values%0A%0A    private final static int BUFFER_SIZE = 4096;%0A%0A    //endregion%0A%0A    //region Public methods%0A%0A    public static void zipFolder(final File srcFolder, final File dstZipFile) throws IOException %7B%0A        ZipOutputStream zip = null;%0A        try %7B%0A            zip = new ZipOutputStream(new FileOutputStream(dstZipFile));%0A            addFolderToZip(%22%22, srcFolder, zip);%0A        %7D finally %7B%0A            if (zip != null) %7B%0A                try %7B%0A                    zip.close();%0A                %7D catch (IOException ignored) %7B %7D%0A            %7D%0A        %7D%0A    %7D%0A%0A    public static void unzipRecursive(final File srcZipFile, final File dstRoot) throws IOException %7B%0A        ZipFile zip = new ZipFile(srcZipFile);%0A        Enumeration%3C? extends ZipEntry%3E entries = zip.entries();%0A        while (entries.hasMoreElements()) %7B%0A            ZipEntry entry = entries.nextElement();%0A            File dstFile = new File(dstRoot, entry.getName());%0A%0A            File parent = dstFile.getParentFile();%0A            if (!parent.isDirectory() && !parent.mkdirs())%0A                throw new IOException(%22Could not create root directory: %22+parent.getAbsolutePath());%0A%0A            if (!entry.isDirectory()) %7B%0A                InputStream in = null;%0A                FileOutputStream out = null;%0A                try %7B%0A                    in = zip.getInputStream(entry);%0A                    out = new FileOutputStream(dstFile);%0A%0A                    int count;%0A                    byte%5B%5D buffer = new byte%5BBUFFER_SIZE%5D;%0A                    while ((count = in.read(buffer, 0, BUFFER_SIZE)) != -1)%0A                        out.write(buffer, 0, count);%0A                %7D finally %7B%0A                    if (in != null) %7B%0A                        try %7B%0A                            in.close();%0A                        %7D catch (IOException ignored) %7B %7D%0A                    %7D%0A                    if (out != null) %7B%0A                        try %7B%0A                            out.close();%0A                        %7D catch (IOException ignored) %7B %7D%0A                    %7D%0A                %7D%0A            %7D%0A        %7D%0A    %7D%0A%0A    //endregion%0A%0A    //region Private methods%0A%0A    private static void addFileToZip(final String path, final File srcFile,%0A                                     final ZipOutputStream zip) throws IOException %7B%0A        if (srcFile.isDirectory()) %7B%0A            addFolderToZip(path, srcFile, zip);%0A        %7D else %7B%0A            FileInputStream in = null;%0A            try %7B%0A                in = new FileInputStream(srcFile);%0A                zip.putNextEntry(new ZipEntry(path + %22/%22 + srcFile.getName()));%0A%0A                int count;%0A                byte%5B%5D buffer = new byte%5BBUFFER_SIZE%5D;%0A                while ((count = in.read(buffer)) %3E 0)%0A                    zip.write(buffer, 0, count);%0A%0A            %7D finally %7B%0A                if (in != null) %7B%0A                    try %7B%0A                        in.close();%0A                    %7D catch (IOException ignored) %7B %7D%0A                %7D%0A            %7D%0A        %7D%0A    %7D%0A%0A    private static void addFolderToZip(String path, final File srcFolder,%0A                                       final ZipOutputStream zip) throws IOException %7B%0A        path = path.isEmpty() ?%0A                srcFolder.getName() :%0A                path + %22/%22 + srcFolder.getName();%0A%0A        for (File file : srcFolder.listFiles())%0A            addFileToZip(path, file, zip);%0A    %7D%0A%0A    //endregion%0A%7D%0A

Add ZipUtils class