File (@NotNull File jarFile, String @NotNull ... namesAndTexts) { try (ZipOutputStream stream = new ZipOutputStream(new FileOutputStream(jarFile))) { for (int i = 0; i < namesAndTexts.length; i += 2) { stream.putNextEntry(new ZipEntry(namesAndTexts[i])); if (namesAndTexts[i + 1] != null) stream.write(namesAndTexts[i + 1].getBytes(StandardCharsets.UTF_8)); stream.closeEntry(); } return jarFile; } catch (IOException e) { throw new RuntimeException(e); } }