Class XmlFileVersionProvider
- java.lang.Object
-
- org.craftercms.commons.upgrade.impl.providers.AbstractVersionProvider<String>
-
- org.craftercms.studio.impl.v2.upgrade.providers.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 ofVersionProvider
for XML files.- Author:
- joseross
-
-
Field Summary
Fields Modifier and Type Field Description protected ContentRepository
contentRepository
protected String
defaultVersion
Version returned if none is found.protected String
path
Path of the file containing the version.protected boolean
skipIfMissing
Indicates if the skip flag should be returnedprotected String
xpath
XPath's expression to extract the version.
-
Constructor Summary
Constructors Constructor Description XmlFileVersionProvider(String path, String xpath, String defaultVersion, ContentRepository contentRepository)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
doGetVersion(org.craftercms.commons.upgrade.impl.UpgradeContext<String> context)
protected void
doSetVersion(org.craftercms.commons.upgrade.impl.UpgradeContext<String> context, String newVersion)
protected String
getFilePath(StudioUpgradeContext context)
void
setPath(String path)
void
setSkipIfMissing(boolean skipIfMissing)
-
-
-
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
-
contentRepository
protected ContentRepository contentRepository
-
-
Constructor Detail
-
XmlFileVersionProvider
@ConstructorProperties({"path","xpath","defaultVersion","contentRepository"}) public XmlFileVersionProvider(String path, String xpath, String defaultVersion, ContentRepository contentRepository)
-
-
Method Detail
-
setPath
public void setPath(String path)
-
setSkipIfMissing
public void setSkipIfMissing(boolean skipIfMissing)
-
getFilePath
protected String getFilePath(StudioUpgradeContext context)
-
doGetVersion
protected String doGetVersion(org.craftercms.commons.upgrade.impl.UpgradeContext<String> context) throws Exception
-
-