private WorkspaceResource handleSingle(@Nonnull WorkspaceFileResourceBuilder builder,
	                                       @Nonnull String pathName, @Nonnull ByteSource source) throws IOException {
		// Read input as raw info in order to determine file-type.
		PathAndName pathAndName = PathAndName.fromString(pathName);
		String name = pathAndName.name;
		Path localPath = pathAndName.path;
		Info readInfo = infoImporter.readInfo(name, source);

		// Check if it is a single class.
		if (readInfo.isClass()) {
			// If it is a class, we know it MUST be a single JVM class since Android classes do not exist
			// in single file form. They only come bundled in DEX files.
			JvmClassInfo readAsJvmClass = readInfo.asClass().asJvmClass();
			BasicJvmClassBundle bundle = new BasicJvmClassBundle();
			bundle.initialPut(readAsJvmClass);

			// To satisfy our file-info requirement for the file resource we can create a wrapper file-info
			// using the JVM class's bytecode.
			FileInfo fileInfo = new FileInfoBuilder<>()
					.withName(readAsJvmClass.getName() + ".class")
					.withRawContent(readAsJvmClass.getBytecode())
					.build();
			if (localPath != null)
				InputFilePathProperty.set(fileInfo, localPath); // Associate input path with the read value.
			return builder.withFileInfo(fileInfo)
					.withJvmClassBundle(bundle)
					.build();
		}

		// Associate input path with the read value.
		if (localPath != null) InputFilePathProperty.set(readInfo, localPath);

		// Must be some non-class type of file.
		FileInfo readInfoAsFile = readInfo.asFile();
		builder = builder.withFileInfo(readInfoAsFile);

		// Check for general ZIP container format (ZIP/JAR/WAR/APK/JMod)
		if (readInfoAsFile.isZipFile()) {
			ZipFileInfo readInfoAsZip = readInfoAsFile.asZipFile();
			return handleZip(builder, readInfoAsZip, source);
		} else if (ZipMarkerProperty.get(readInfoAsFile)) {
			// In some cases the file may have been matched as something else (like an executable)
			// but also count as a ZIP container. Applications that bundle Java applications into native exe files
			// tend to do this.
			try {
				return handleZip(builder, new ZipFileInfoBuilder(readInfoAsFile.toFileBuilder()).build(), source);
			} catch (Throwable t) {
				// Some files will just so happen to have a ZIP marker in their bytes but not represent an actual ZIP.
				// This is fine because by this point we have an info-type to fall back on.
				logger.debug("Saw ZIP marker in file {} but could not parse as ZIP.", name);
			}
		}

		// Check for DEX file format.
		if (readInfoAsFile instanceof DexFileInfo) {
			String dexName = readInfoAsFile.getName();
			AndroidClassBundle dexBundle = DexIOUtil.read(readInfoAsFile.getRawContent());
			return builder.withAndroidClassBundles(Map.of(dexName, dexBundle))
					.build();
		}

		// Must be some edge case type: Modules, or an unknown file type
		if (readInfoAsFile instanceof ModulesFileInfo) {
			return handleModules(builder, (ModulesFileInfo) readInfoAsFile);
		}

		// Unknown file type
		BasicFileBundle bundle = new BasicFileBundle();
		bundle.initialPut(readInfoAsFile);
		return builder
				.withFileBundle(bundle)
				.build();
	}
General read handling for any single-file resource kind. Delegates to others when needed.

@param builder
		Builder to work with.
@param pathName
		Name of input file / content.
@param source
		Access to content / data.

@return Read resource.
recaf-core/src/main/java/software/coley/recaf/services/workspace/io/BasicResourceImporter.java