public static Resource prepareClasspathResourceIfNeeded(final Resource resource) {
        if (resource == null) {
            LOGGER.debug("No resource defined to prepare.");
            return null;
        }
        return prepareClasspathResourceIfNeeded(resource, false, resource.getFilename());
    }
Prepare classpath resource if needed file.

@param resource the resource
@return the file
core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/ResourceUtils.java