public static RefTarget toFileRef(String fileReference, ResourceResolver siblingResolver) {
		String[] split = fileReference.split("=", 2);
		String src;
		String dest = null;

		if (split.length == 1) {
			src = split[0];
		} else {
			dest = split[0];
			src = split[1];
		}

		Path p = dest != null ? Paths.get(dest) : null;

		if (Paths.get(src).isAbsolute()) {
			throw new IllegalStateException(
					"Only relative paths allowed in //FILES. Found absolute path: " + src);
		}
		if (p != null && p.isAbsolute()) {
			throw new IllegalStateException(
					"Only relative paths allowed in //FILES. Found absolute path: " + dest);
		}

		try {
			ResourceRef ref = siblingResolver.resolve(src);
			if (ref == null) {
				throw new ExitException(EXIT_INVALID_INPUT,
						String.format("Could not find '%s' when resolving '%s' in %s",
								src,
								fileReference,
								siblingResolver.description()));
			}
			if (dest != null && dest.endsWith("/")) {
				p = p.resolve(ref.getFile().getFileName());
			}
			return RefTarget.create(ref, p);
		} catch (ResourceNotFoundException rnfe) {
			throw new ExitException(EXIT_INVALID_INPUT, String.format("Could not find '%s' when resolving '%s' in %s",
					rnfe.getResourceDescription(),
					fileReference,
					siblingResolver.description()),
					rnfe);
		}
	}
Turns a reference like `img/logo.jpg` or `WEB-INF/index.html=web/index.html`
into a <code>RefTarget</code>. In case no alias was supplied the
<code>RefTarget</code>'s target will be <code>null</code>. When an alias
terminates in a <code>/</code> the alias will be assumed to be a folder name
and the source's file name will be appended to it, meaning that given
`WEB-INF/=web/index.html` this method will return a <code>RefTarget</code> as
if `WEB-INF/index.html=web/index.html` was supplied.
src/main/java/dev/jbang/source/TagReader.java