Even if I exclude the part in which I add files to the new created zip, it gets corrupted. Upon opening the archive I get "Error occurred" message.
package com.codegym.task.task31.task3105;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import java.util.zip.ZipOutputStream;

Adding a file to an archive

public class Solution {
    public static void main(String[] args) throws IOException {

        File newFile = new File(args[0]);

        ZipInputStream zipFile = new ZipInputStream(new FileInputStream(args[1]));
        List<ZipEntry> filesFromZip = new ArrayList<>();
        ZipEntry entry = null;

        while ((entry = zipFile.getNextEntry())!=null){

        ZipOutputStream zipOut = new ZipOutputStream(new FileOutputStream(args[1]));

        for (int i = 0; i <filesFromZip.size() ; i++) {



        zipOut.putNextEntry(new ZipEntry("/new/"));
        zipOut.putNextEntry(new ZipEntry("new/" + newFile));