default BeanSupplier<T> ifExists(final String resource) {
        return when(() -> ResourceUtils.doesResourceExist(resource));
    }
Add condition to ensure given resource exist.

@param resource the resource
@return the bean supplier
core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/spring/beans/BeanSupplier.java