Class AddFileUpgradeOperation
- 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.file.AddFileUpgradeOperation
-
- 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 AddFileUpgradeOperation extends AbstractUpgradeOperation
Implementation ofUpgradeOperation
that adds a new file to a repository.Supported YAML properties:
- path: (required) the relative path to write the file in the repository
- file: (required) the location of the file to copy
- Author:
- joseross
-
-
Field Summary
Fields Modifier and Type Field Description static String
CONFIG_KEY_FILE
static String
CONFIG_KEY_PATH
protected org.springframework.core.io.Resource
file
The file to copy from the classpath.protected String
path
The path to write the file.-
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 AddFileUpgradeOperation(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_PATH
public static final String CONFIG_KEY_PATH
- See Also:
- Constant Field Values
-
CONFIG_KEY_FILE
public static final String CONFIG_KEY_FILE
- See Also:
- Constant Field Values
-
path
protected String path
The path to write the file.
-
file
protected org.springframework.core.io.Resource file
The file to copy from the classpath.
-
-
Constructor Detail
-
AddFileUpgradeOperation
public AddFileUpgradeOperation(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
-
-