public void createZip(Path source) throws Exception {
        if (!Files.isDirectory(zipFile.getParent())) Files.createDirectory(zipFile.getParent());
        try (ZipOutputStream zos = new ZipOutputStream(Files.newOutputStream(zipFile))) {
            if (Files.isRegularFile(source)) {
                addNewZipEntry(zos, source.getParent(), source.getFileName());
            } else if (Files.isDirectory(source)) {
                FileManager fileManager = new FileManager(source);
                List<Path> fileNames = fileManager.getFileList();
                for (Path path : fileNames) {
                    addNewZipEntry(zos, path.getParent(), path.getFileName());
                }
            } else throw new PathIsNotFoundException();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    private void addNewZipEntry(ZipOutputStream zipOutputStream, Path filePath, Path fileName) throws Exception {
        Path path = filePath.resolve(fileName);
        try (InputStream inputStream = Files.newInputStream(path)) {
            //ZipEntry zipEntry = new ZipEntry(fileName.getFileName().toString());
            ZipEntry zipEntry = new ZipEntry(fileName.toString());
            zipOutputStream.putNextEntry(zipEntry);
            copyData(inputStream, zipOutputStream);
            zipOutputStream.closeEntry();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
Пробовал addNewZipEntry(zos, path.getParent(), path.getFileName()); менять на addNewZipEntry(zos, source, path.getFileName()); не помогло. Убрал еще catch (Exception e). Не помогло.