docs: @SuppressWarnings("checkstyle:npathcomplexity")
  	public static void zipFile(File input, OutputStream output) throws IOException {
  
  		try (ZipOutputStream zos = new ZipOutputStream(output)) {
  			if (input == null) {
  				return;
  			}
  
  			final LinkedList<File> candidates = new LinkedList<>();
  			candidates.add(input);
  
  			final byte[] buffer = new byte[BUFFER_SIZE];
  			int len;
  			File file;
  			File relativeFile;
  			String zipFilename;
  
  			final File rootDirectory = (input.isDirectory()) ? input : input.getParentFile();
  
  			while (!candidates.isEmpty()) {
  				file = candidates.removeFirst();
  				assert file != null;
  
  				if (file.getAbsoluteFile().equals(rootDirectory.getAbsoluteFile())) {
  					relativeFile = null;
  				} else {
  					relativeFile = makeRelative(file, rootDirectory, false);
  				}
  
  				if (file.isDirectory()) {
  					if (relativeFile != null) {
  						zipFilename = fromFileStandardToURLStandard(relativeFile) + URL_PATH_SEPARATOR;
  						final ZipEntry zipEntry = new ZipEntry(zipFilename);
  						zos.putNextEntry(zipEntry);
  						zos.closeEntry();
  					}
  					candidates.addAll(Arrays.asList(file.listFiles()));
  				} else if (relativeFile != null) {
  					try (FileInputStream fis = new FileInputStream(file)) {
  						zipFilename = fromFileStandardToURLStandard(relativeFile);
  						final ZipEntry zipEntry = new ZipEntry(zipFilename);
  						zos.putNextEntry(zipEntry);
  						while ((len = fis.read(buffer)) > 0) {
  							zos.write(buffer, 0, len);
  						}
  						zos.closeEntry();
  					}
  				}
  			}
  		}
  	}