Class GlobalRepoUpgradeOperation
- 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.global.GlobalRepoUpgradeOperation
-
- 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 GlobalRepoUpgradeOperation extends AbstractUpgradeOperation
Implementation ofUpgradeOperation
that updates files on the global repository.Supported YAML properties:
- files: (required) list of paths to copy to the global repository. The format of each entry of this list is {SRC_PATH}:{GLOBAL_REPO_DEST_PATH}. The first component is the path of the source file to copy, and the second component is the destination path in the global repo.
- overwrite: (optional, defaults to true) Indicates if existing files should be overwritten.
- Author:
- joseross
-
-
Field Summary
Fields Modifier and Type Field Description static String
CONFIG_KEY_DEST
static String
CONFIG_KEY_FILES
static String
CONFIG_KEY_OVERWRITE
static String
CONFIG_KEY_SRC
protected Map<org.springframework.core.io.Resource,String>
files
List of paths to update.protected boolean
overwrite
Indicates if existing files should be overwritten-
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 GlobalRepoUpgradeOperation(StudioConfiguration studioConfiguration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doExecute(StudioUpgradeContext context)
void
doInit(org.apache.commons.configuration2.HierarchicalConfiguration config)
-
Methods inherited from class org.craftercms.studio.impl.v2.upgrade.operations.AbstractUpgradeOperation
commitAllChanges, doExecute, getCommitMessage, init, loadResource, setServletContext, trackChangedFiles, trackDeletedFiles
-
-
-
-
Field Detail
-
CONFIG_KEY_FILES
public static final String CONFIG_KEY_FILES
- See Also:
- Constant Field Values
-
CONFIG_KEY_SRC
public static final String CONFIG_KEY_SRC
- See Also:
- Constant Field Values
-
CONFIG_KEY_DEST
public static final String CONFIG_KEY_DEST
- See Also:
- Constant Field Values
-
CONFIG_KEY_OVERWRITE
public static final String CONFIG_KEY_OVERWRITE
- See Also:
- Constant Field Values
-
overwrite
protected boolean overwrite
Indicates if existing files should be overwritten
-
-
Constructor Detail
-
GlobalRepoUpgradeOperation
public GlobalRepoUpgradeOperation(StudioConfiguration studioConfiguration)
-
-
Method Detail
-
doInit
public void doInit(org.apache.commons.configuration2.HierarchicalConfiguration config)
- Overrides:
doInit
in classorg.craftercms.commons.upgrade.impl.operations.AbstractUpgradeOperation<String>
-
doExecute
public void doExecute(StudioUpgradeContext context) throws org.craftercms.commons.upgrade.exception.UpgradeException
- Specified by:
doExecute
in classAbstractUpgradeOperation
- Throws:
org.craftercms.commons.upgrade.exception.UpgradeException
-
-