private static void copyToZip(ZipOutputStream output, File from, boolean keepManifest) throws IOException {
		ZipFile input = new ZipFile(from);
		Enumeration<? extends ZipEntry> entries = input.entries();
		while (entries.hasMoreElements()) {
			try {
				ZipEntry entry = entries.nextElement();
				
				if (!keepManifest && entry.getName().equals("META-INF/MANIFEST.MF")) {
					// Continue with the next entry in case it is the manifest.
					continue;
				}
				
				output.putNextEntry(entry);
				
				InputStream inputStream = input.getInputStream(entry);
				byte[] buffer = new byte[4096];
				while (inputStream.available() > 0) {
					output.write(buffer, 0, inputStream.read(buffer, 0, buffer.length));
				}
				inputStream.close();
				output.closeEntry();
			} catch (ZipException e) {
				// Assume that the error is the warning about a duplicate and
				// ignore it.
				// I know that this is evil...
			}
		}
		input.close();
	}