@Override
		public void export(@Nonnull Workspace workspace) throws IOException {
			populate(workspace);
			switch (outputType) {
				case FILE:
					// Test if we're supposed to just write the file as-is instead of bundling it in an archive.
					//  - Must only have one thing to write
					//  - Workspace input must be a single non-archive file
					if (contents.size() == 1 &&
							workspace.getPrimaryResource() instanceof WorkspaceFileResource primaryFileResource &&
							!(primaryFileResource.getFileInfo() instanceof ZipFileInfo)) {
						byte[] data = contents.values().iterator().next();
						if (prefix != null)
							consumer.write(prefix);
						consumer.write(data);
						return;
					}

					// Otherwise, lets make an archive.
					ZipCreationUtils.ZipBuilder zipBuilder = ZipCreationUtils.builder();
					if (createZipDirEntries)
						zipBuilder = zipBuilder.createDirectories();

					// Final copy for lambda, write all contents to ZIP buffer.
					ZipCreationUtils.ZipBuilder finalZipBuilder = zipBuilder;
					contents.forEach((name, content) -> {
						// Cannot mirror exact compression type, so we'll just do binary "is this compressed or nah?"
						boolean compress = compression.getOrDefault(name, STORED) > STORED;

						// Other properties
						String comment = comments.getOrDefault(name, null);
						long modifyTime = modifyTimes.getOrDefault(name, -1L);
						long createTime = createTimes.getOrDefault(name, -1L);
						long accessTime = accessTimes.getOrDefault(name, -1L);

						// Adding the entry
						finalZipBuilder.add(name, content, compress, comment, createTime, modifyTime, accessTime);
					});

					// Write buffer to path
					if (prefix != null) {
						consumer.write(prefix);
						consumer.write(zipBuilder.bytes());
					} else {
						consumer.write(zipBuilder.bytes());
					}
					consumer.commit();
					break;
				case DIRECTORY:
					for (Map.Entry<String, byte[]> entry : contents.entrySet()) {
						// Write everything relative to the path
						String relativePath = entry.getKey();
						byte[] content = entry.getValue();
						consumer.writeRelative(relativePath, content);
					}
					consumer.commit();
					break;
			}
		}
Basic implementation of {@link WorkspaceExporter} that pulls from the options defined here.
recaf-core/src/main/java/software/coley/recaf/services/workspace/io/WorkspaceExportOptions.java