private static Map<String, YubiKeyAccount> getDevicesFromJsonResource(final Resource jsonResource) {
        return FunctionUtils.doUnchecked(() -> {
            if (!ResourceUtils.doesResourceExist(jsonResource)) {
                val res = jsonResource.getFile().createNewFile();
                if (res) {
                    LOGGER.debug("Created JSON resource @ [{}]", jsonResource);
                }
            }
            if (ResourceUtils.doesResourceExist(jsonResource)) {
                val file = jsonResource.getFile();
                if (file.canRead() && file.length() > 0) {
                    return MAPPER.readValue(file, new TypeReference<>() {
                    });
                }
            } else {
                LOGGER.warn("JSON resource @ [{}] does not exist", jsonResource);
            }
            return new HashMap<>();
        });
    }
This is {@link JsonYubiKeyAccountRegistry}.

@author Misagh Moayyed
@since 5.2.0
support/cas-server-support-yubikey-core/src/main/java/org/apereo/cas/adaptors/yubikey/registry/JsonYubiKeyAccountRegistry.java