Class ConfigEncryptionUpgradeOperation
- java.lang.Object
-
- org.craftercms.commons.upgrade.impl.operations.AbstractUpgradeOperation<String>
-
- org.craftercms.studio.impl.v2.upgrade.operations.AbstractUpgradeOperation
-
- org.craftercms.studio.impl.v2.upgrade.operations.site.AbstractContentUpgradeOperation
-
- org.craftercms.studio.impl.v2.upgrade.operations.site.ConfigEncryptionUpgradeOperation
-
- All Implemented Interfaces:
org.craftercms.commons.upgrade.UpgradeOperation<String>
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
,org.springframework.web.context.ServletContextAware
public class ConfigEncryptionUpgradeOperation extends AbstractContentUpgradeOperation
Implementation ofAbstractContentUpgradeOperation
that upgrades encrypted properties in configuration files.- Since:
- 3.1.9
- Author:
- joseross
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.craftercms.studio.impl.v2.upgrade.operations.site.AbstractContentUpgradeOperation
AbstractContentUpgradeOperation.ListFileVisitor
-
-
Field Summary
Fields Modifier and Type Field Description protected static String
DEFAULT_ENCRYPTED_PATTERN
protected Pattern
encryptedPattern
protected org.craftercms.commons.crypto.TextEncryptor
textEncryptor
-
Fields inherited from class org.craftercms.studio.impl.v2.upgrade.operations.site.AbstractContentUpgradeOperation
CONFIG_KEY_INCLUDED_PATHS, includedPaths
-
Fields inherited from class org.craftercms.studio.impl.v2.upgrade.operations.AbstractUpgradeOperation
changedFiles, commitDetails, CONFIG_KEY_COMMIT_DETAILS, deletedFiles, servletContext, studioConfiguration
-
-
Constructor Summary
Constructors Constructor Description ConfigEncryptionUpgradeOperation(StudioConfiguration studioConfiguration, org.craftercms.commons.crypto.TextEncryptor textEncryptor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
shouldBeUpdated(StudioUpgradeContext context, Path file)
Indicates if the given file should be updated by this classprotected void
updateFile(StudioUpgradeContext context, Path path)
Performs any needed updates on the content of the given file-
Methods inherited from class org.craftercms.studio.impl.v2.upgrade.operations.site.AbstractContentUpgradeOperation
doExecute, doInit, filterPaths, findIncludedPaths, readFile, writeFile
-
Methods inherited from class org.craftercms.studio.impl.v2.upgrade.operations.AbstractUpgradeOperation
commitAllChanges, doExecute, getCommitMessage, init, loadResource, setServletContext, trackChangedFiles, trackDeletedFiles
-
-
-
-
Constructor Detail
-
ConfigEncryptionUpgradeOperation
@ConstructorProperties({"studioConfiguration","textEncryptor"}) public ConfigEncryptionUpgradeOperation(StudioConfiguration studioConfiguration, org.craftercms.commons.crypto.TextEncryptor textEncryptor)
-
-
Method Detail
-
shouldBeUpdated
protected boolean shouldBeUpdated(StudioUpgradeContext context, Path file)
Description copied from class:AbstractContentUpgradeOperation
Indicates if the given file should be updated by this class- Specified by:
shouldBeUpdated
in classAbstractContentUpgradeOperation
- Parameters:
context
- the current upgrade contextfile
- the file to check- Returns:
- true if the file should be updated
-
updateFile
protected void updateFile(StudioUpgradeContext context, Path path) throws org.craftercms.commons.upgrade.exception.UpgradeException
Description copied from class:AbstractContentUpgradeOperation
Performs any needed updates on the content of the given file- Specified by:
updateFile
in classAbstractContentUpgradeOperation
- Parameters:
context
- the current upgrade contextpath
- the file to update- Throws:
org.craftercms.commons.upgrade.exception.UpgradeException
- if there is any error updating the file
-
-