Class XmlFileVersionProvider

  • All Implemented Interfaces:
    org.craftercms.commons.upgrade.VersionProvider<String>
    Direct Known Subclasses:
    SiteVersionProvider

    public class XmlFileVersionProvider
    extends org.craftercms.commons.upgrade.impl.providers.AbstractVersionProvider<String>
    Implementation of VersionProvider for XML files.
    Author:
    joseross
    • Field Detail

      • path

        protected String path
        Path of the file containing the version.
      • xpath

        protected String xpath
        XPath's expression to extract the version.
      • defaultVersion

        protected String defaultVersion
        Version returned if none is found.
      • skipIfMissing

        protected boolean skipIfMissing
        Indicates if the skip flag should be returned
    • Method Detail

      • setPath

        public void setPath​(String path)
      • setSkipIfMissing

        public void setSkipIfMissing​(boolean skipIfMissing)
      • doGetVersion

        protected String doGetVersion​(org.craftercms.commons.upgrade.impl.UpgradeContext<String> context)
                               throws Exception
        Specified by:
        doGetVersion in class org.craftercms.commons.upgrade.impl.providers.AbstractVersionProvider<String>
        Throws:
        Exception
      • doSetVersion

        protected void doSetVersion​(org.craftercms.commons.upgrade.impl.UpgradeContext<String> context,
                                    String newVersion)
                             throws Exception
        Specified by:
        doSetVersion in class org.craftercms.commons.upgrade.impl.providers.AbstractVersionProvider<String>
        Throws:
        Exception