public String getResourceVersion()

in extscript-core-root/extscript-core/src/main/java/org/apache/myfaces/extensions/scripting/jsf/resources/deprecated/ExternalContextResourceLoader.java [61:100]


    public String getResourceVersion(String path)
    {
        String resourceVersion = null;
        Set<String> resourcePaths = this.getResourcePaths(path);
        if (getPrefix() != null)
            path = getPrefix() + '/' + path;

        if (null != resourcePaths && !resourcePaths.isEmpty())
        {
            // resourceVersion = // execute the comment
            // Look in the resourcePaths for versioned resources.
            // If one or more versioned resources are found, take
            // the one with the "highest" version number as the value
            // of resourceVersion. If no versioned libraries
            // are found, let resourceVersion remain null.
            for (String resourcePath : resourcePaths)
            {
                String version = resourcePath.substring(path.length());

                if (RESOURCE_VERSION_CHECKER.matcher(version).matches())
                {
                    version = version.substring(1, version.lastIndexOf('.'));
                    if (resourceVersion == null)
                    {
                        resourceVersion = version;
                    }
                    else if (getVersionComparator().compare(resourceVersion, version) < 0)
                    {
                        resourceVersion = version;
                    }
                }
            }
            //Since it is a directory and no version was found, set as invalid
            if (resourceVersion == null)
            {
                resourceVersion = VERSION_INVALID;
            }
        }
        return resourceVersion;
    }