@Override
	public ResourceRef resolve(String resource, boolean trusted) {
		ResourceRef result = null;

		if (resource.startsWith("http://") || resource.startsWith("https://") || resource.startsWith("file:/")) {
			result = ResourceRef.forLazyFileResource(resource,
					ref -> {
						try {
							return alwaysTrust || trusted ? fetchFromURL(ref) : fetchScriptFromUntrustedURL(ref);
						} catch (IOException | URISyntaxException e) {
							throw new ResourceNotFoundException(resource, "Could not download", e);
						}
					});
		}

		return result;
	}
A <code>ResourceResolver</code> that, when given a resource string which
looks like a http, https or file URL, will try to download the referenced
document to the cache and return a reference to that file.
src/main/java/dev/jbang/source/resolvers/RemoteResourceResolver.java