private T getObject(FolderItem item, int version, Object consumer, TaskMonitor monitor,
			boolean immutable) throws IOException, VersionException, CancelledException {

		URL ghidraUrl = getURL(item);

		Class<?> domainObjectClass = getDomainObjectClass();
		if (domainObjectClass == null) {
			throw new UnsupportedOperationException("");
		}

		AtomicReference<VersionException> verExcRef = new AtomicReference<>();
		AtomicReference<T> domainObjectRef = new AtomicReference<>();
		GhidraURLQuery.queryUrl(ghidraUrl, new GhidraURLResultHandlerAdapter(true) {

			@Override
			public void processResult(DomainFile domainFile, URL url, TaskMonitor m)
					throws IOException, CancelledException {
				if (!getDomainObjectClass().isAssignableFrom(domainFile.getDomainObjectClass())) {
					throw new BadLinkException("Expected " + getDomainObjectClass() +
						" but linked to " + domainFile.getDomainObjectClass());
				}
				try {
					@SuppressWarnings("unchecked")
					T linkedObject = immutable
							? (T) domainFile.getImmutableDomainObject(consumer, version, monitor)
							: (T) domainFile.getReadOnlyDomainObject(consumer, version, monitor);
					domainObjectRef.set(linkedObject);
				}
				catch (VersionException e) {
					verExcRef.set(e);
				}
			}

			@Override
			public void handleUnauthorizedAccess(URL url) throws IOException {
				throw new IOException("Authorization failure");
			}
		}, monitor);

		VersionException versionException = verExcRef.get();
		if (versionException != null) {
			throw versionException;
		}

		T domainObj = domainObjectRef.get();
		if (domainObj == null) {
			throw new IOException(
				"Failed to obtain linked object for unknown reason: " + item.getPathName());
		}
		return domainObj;
	}
Create a link file using the specified URL
@param ghidraUrl link URL (must be a Ghidra URL - see {@link GhidraURL}).
@param fs filesystem where link file should be created 
@param folderPath folder path which should contain link file
@param linkFilename link filename
@throws IOException if an IO error occurs
@throws InvalidNameException if invalid folderPath or linkFilename specified
Ghidra/Framework/Project/src/main/java/ghidra/framework/data/LinkHandler.java