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 of UpgradeOperation 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 Details

    • CONFIG_KEY_PATH

      public static final String CONFIG_KEY_PATH
      See Also:
    • CONFIG_KEY_FILE

      public static final String CONFIG_KEY_FILE
      See Also:
    • 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 Details

    • AddFileUpgradeOperation

      public AddFileUpgradeOperation(StudioConfiguration studioConfiguration)
  • Method Details

    • doInit

      public void doInit(org.apache.commons.configuration2.HierarchicalConfiguration config)
      Overrides:
      doInit in class org.craftercms.commons.upgrade.impl.operations.AbstractUpgradeOperation<String>
    • doExecute

      public void doExecute(StudioUpgradeContext context) throws org.craftercms.commons.upgrade.exception.UpgradeException
      Specified by:
      doExecute in class AbstractUpgradeOperation
      Throws:
      org.craftercms.commons.upgrade.exception.UpgradeException