private static DatabaseReader readDatabase(final Resource maxmindDatabase) {
        return FunctionUtils.doIf(ResourceUtils.doesResourceExist(maxmindDatabase),
                Unchecked.supplier(() ->
                    new DatabaseReader.Builder(maxmindDatabase.getFile())
                        .fileMode(Reader.FileMode.MEMORY)
                        .withCache(new CHMCache())
                        .build()),
                () -> null)
            .get();
    }
This is {@link CasGeoLocationMaxmindAutoConfiguration}.

@author Misagh Moayyed
@since 5.0.0
support/cas-server-support-geolocation-maxmind/src/main/java/org/apereo/cas/config/CasGeoLocationMaxmindAutoConfiguration.java