Class XmlStreamVersionProvider
java.lang.Object
org.craftercms.commons.upgrade.impl.providers.AbstractVersionProvider<String>
org.craftercms.studio.impl.v2.upgrade.providers.XmlFileVersionProvider
org.craftercms.studio.impl.v2.upgrade.providers.XmlStreamVersionProvider
- All Implemented Interfaces:
org.craftercms.commons.upgrade.VersionProvider<String>
Extension of
XmlFileVersionProvider that consumes a XMLEventReader
in order to stop reading the XML once the version tag has been found.-
Field Summary
Fields inherited from class org.craftercms.studio.impl.v2.upgrade.providers.XmlFileVersionProvider
contentRepository, defaultVersion, path, skipIfMissing, xpathFields inherited from class org.craftercms.commons.upgrade.impl.providers.AbstractVersionProvider
defaultValue, loggerFields inherited from interface org.craftercms.commons.upgrade.VersionProvider
SKIP, VERSION -
Constructor Summary
ConstructorsConstructorDescriptionXmlStreamVersionProvider(String path, String xpath, String defaultVersion, ContentRepository contentRepository, String versionElementName) -
Method Summary
Modifier and TypeMethodDescriptionprotected StringgetVersionFromFile(String site, String filePath) Get the version from the XML file.Methods inherited from class org.craftercms.studio.impl.v2.upgrade.providers.XmlFileVersionProvider
doGetVersion, doSetVersion, getFilePath, setPath, setSkipIfMissingMethods inherited from class org.craftercms.commons.upgrade.impl.providers.AbstractVersionProvider
getVersion, setDefaultValue, setVersion
-
Constructor Details
-
XmlStreamVersionProvider
@ConstructorProperties({"path","xpath","defaultVersion","contentRepository","versionElementName"}) public XmlStreamVersionProvider(String path, String xpath, String defaultVersion, ContentRepository contentRepository, String versionElementName)
-
-
Method Details
-
getVersionFromFile
Description copied from class:XmlFileVersionProviderGet the version from the XML file. This method assumes the file existence has been checked previously.- Overrides:
getVersionFromFilein classXmlFileVersionProvider- Parameters:
site- Site namefilePath- Path of the file containing the version- Returns:
- the version of the file, as found in the XML file <version> tag
- Throws:
Exception
-