#14 load from jar einfacher

This commit is contained in:
Andreas Penski 2019-06-28 13:58:09 +02:00
parent 165ce94be9
commit b4429bed89
5 changed files with 37 additions and 27 deletions

View file

@ -62,7 +62,14 @@ public class RelativeUriResolver implements URIResolver, UnparsedTextURIResolver
}
}
static URI resolve(final URI href, final URI base) {
/**
* Resolves a relative uri including uris within a jar file.
*
* @param href the uri to resolve
* @param base the base uri
* @return the resolved uri
*/
public static URI resolve(final URI href, final URI base) {
final boolean jarURI = isJarURI(base);
final URI tmpBase = jarURI ? URI.create(base.toASCIIString().substring(4)) : base;
final URI result = tmpBase.resolve(href);