From b5ab04da4c106dbe7c361b8ff874cbb58fd92f9e Mon Sep 17 00:00:00 2001 From: Xavi Aracil Date: Thu, 17 Nov 2022 12:09:07 +0100 Subject: [PATCH] Removed duplicated entry --- .../inspect/vc/util/CachingDocumentLoader.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/inspector-vc/src/main/java/org/oneedtech/inspect/vc/util/CachingDocumentLoader.java b/inspector-vc/src/main/java/org/oneedtech/inspect/vc/util/CachingDocumentLoader.java index aec0cbf..6db88fc 100644 --- a/inspector-vc/src/main/java/org/oneedtech/inspect/vc/util/CachingDocumentLoader.java +++ b/inspector-vc/src/main/java/org/oneedtech/inspect/vc/util/CachingDocumentLoader.java @@ -23,7 +23,7 @@ import com.google.common.io.Resources; /** * A com.apicatalog DocumentLoader with a threadsafe static cache. - * + * * @author mgylling */ public class CachingDocumentLoader implements DocumentLoader { @@ -41,13 +41,12 @@ public class CachingDocumentLoader implements DocumentLoader { static final ImmutableMap bundled = ImmutableMap.builder() .put("https://purl.imsglobal.org/spec/clr/v2p0/context.json",Resources.getResource("contexts/clr-v2p0.json")) - .put("https://purl.imsglobal.org/spec/ob/v3p0/context.json",Resources.getResource("contexts/ob-v3p0.json")) + .put("https://purl.imsglobal.org/spec/ob/v3p0/context.json",Resources.getResource("contexts/ob-v3p0.json")) .put("https://purl.imsglobal.org/spec/ob/v3p0/extensions.json",Resources.getResource("contexts/ob-v3p0-extensions.json")) - .put("https://purl.imsglobal.org/spec/ob/v3p0/context.json",Resources.getResource("contexts/obv3x.jsonld")) .put("https://www.w3.org/ns/did/v1", Resources.getResource("contexts/did-v1.jsonld")) .put("https://www.w3.org/ns/odrl.jsonld", Resources.getResource("contexts/odrl.jsonld")) .put("https://w3id.org/security/suites/ed25519-2020/v1",Resources.getResource("contexts/security-suites-ed25519-2020-v1.jsonld")) - .put("https://www.w3.org/2018/credentials/v1", Resources.getResource("contexts/2018-credentials-v1.jsonld")) + .put("https://www.w3.org/2018/credentials/v1", Resources.getResource("contexts/2018-credentials-v1.jsonld")) .put("https://w3id.org/security/v1", Resources.getResource("contexts/security-v1.jsonld")) .put("https://w3id.org/security/v2", Resources.getResource("contexts/security-v2.jsonld")) .put("https://w3id.org/security/v3", Resources.getResource("contexts/security-v3-unstable.jsonld")) @@ -56,14 +55,14 @@ public class CachingDocumentLoader implements DocumentLoader { .put("https://w3id.org/security/suites/ed25519-2018/v1", Resources.getResource("contexts/suites-ed25519-2018.jsonld")) .put("https://w3id.org/security/suites/x25519-2019/v1", Resources.getResource("contexts/suites-x25519-2019.jsonld")) .put("https://w3id.org/security/suites/jws-2020/v1", Resources.getResource("contexts/suites-jws-2020.jsonld")) - + .build(); static final LoadingCache, Document> documentCache = CacheBuilder.newBuilder() .initialCapacity(32).maximumSize(64).expireAfterAccess(Duration.ofHours(24)) .build(new CacheLoader, Document>() { public Document load(final Tuple id) throws Exception { - try (InputStream is = bundled.keySet().contains(id.t1) + try (InputStream is = bundled.keySet().contains(id.t1) ? bundled.get(id.t1).openStream() : new URI(id.t1).toURL().openStream();) { return JsonDocument.of(is);