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
Implementation of
AbstractContentUpgradeOperation 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
FieldsModifier and TypeFieldDescriptionprotected static Stringprotected Patternprotected org.craftercms.commons.crypto.TextEncryptorFields inherited from class org.craftercms.studio.impl.v2.upgrade.operations.site.AbstractContentUpgradeOperation
CONFIG_KEY_INCLUDED_PATHS, includedPathsFields inherited from class org.craftercms.studio.impl.v2.upgrade.operations.AbstractUpgradeOperation
changedFiles, commitDetails, CONFIG_KEY_COMMIT_DETAILS, deletedFiles, servletContext, studioConfigurationFields inherited from class org.craftercms.commons.upgrade.impl.operations.AbstractUpgradeOperation
applicationContext, currentVersion, enabled, nextVersion -
Constructor Summary
ConstructorsConstructorDescriptionConfigEncryptionUpgradeOperation(StudioConfiguration studioConfiguration, org.craftercms.commons.crypto.TextEncryptor textEncryptor) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanshouldBeUpdated(StudioUpgradeContext context, Path file) Indicates if the given file should be updated by this classprotected voidupdateFile(StudioUpgradeContext context, Path path) Performs any needed updates on the content of the given fileMethods inherited from class org.craftercms.studio.impl.v2.upgrade.operations.site.AbstractContentUpgradeOperation
doExecute, doInit, filterPaths, findIncludedPaths, readFile, writeFileMethods inherited from class org.craftercms.studio.impl.v2.upgrade.operations.AbstractUpgradeOperation
commitAllChanges, doExecute, getCommitMessage, init, loadResource, setServletContext, trackChangedFiles, trackDeletedFilesMethods inherited from class org.craftercms.commons.upgrade.impl.operations.AbstractUpgradeOperation
execute, setApplicationContext, setEnabled
-
Field Details
-
DEFAULT_ENCRYPTED_PATTERN
-
encryptedPattern
-
textEncryptor
protected org.craftercms.commons.crypto.TextEncryptor textEncryptor
-
-
Constructor Details
-
ConfigEncryptionUpgradeOperation
@ConstructorProperties({"studioConfiguration","textEncryptor"}) public ConfigEncryptionUpgradeOperation(StudioConfiguration studioConfiguration, org.craftercms.commons.crypto.TextEncryptor textEncryptor)
-
-
Method Details
-
shouldBeUpdated
Description copied from class:AbstractContentUpgradeOperationIndicates if the given file should be updated by this class- Specified by:
shouldBeUpdatedin 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:AbstractContentUpgradeOperationPerforms any needed updates on the content of the given file- Specified by:
updateFilein 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
-