org.appng.cli.commands.platform

## Class ExtractData

- java.lang.Object
- - org.appng.cli.commands.platform.ExtractData

- All Implemented Interfaces:
    ExecutableCliCommand

      public class ExtractData
      extends Object
      implements ExecutableCliCommand

  Extracts the data from `$APPNG_HOME` to `$appngData`.
  This includes moving
  - `WEB-INF/web.xml` to `$appngData/WEB-INF/web.xml`
  - `WEB-INF/conf` to `$appngData/conf`
  - `WEB-INF/bin` to `$appngData/bin`
  - `WEB-INF/logs` to `$appngData/logs`
  - `/applications` to `$appngData/applications`
  - `/repository` to `$appngData/repository`
  .

  Additionally, a <Resources> element is being added to `$APPNG_HOME/META-INF/context.xml`, referencing the `appngData` directory.

       Usage: extract-data [options]
         Options:
         * -appngData
             The folder to extract the data to.
           -copy
             Copy data instead of moving.
             Default: false
           -revert
             Revert previously extracted data.
             Default: false

  Author:
    Matthias Müller

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ExtractData()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `copyBatchFileToBin(File binFolder, String appngData, String appngHome, String name)`
    `void` | `execute(CliEnvironment cle)` Executes the command.
    `protected void` | `extract(String appngHome, CliEnvironment cle, String applicationDir, String repositoryPath)`
    `protected static void` | `replaceInFile(File file, String search, String replacement)`
    `protected void` | `setCacheConfig(CliEnvironment cle)`
    `protected void` | `writeContextXml(String appngHome)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ExtractData

          public ExtractData()

  - ### Method Detail

    - #### execute

          public void execute(CliEnvironment cle)
                       throws BusinessException

      Description copied from interface: `ExecutableCliCommand`
      Executes the command.
      Specified by:
        `execute` in interface `ExecutableCliCommand`
      Parameters:
        `cle` - the `CliEnvironment` to use
      Throws:
        `BusinessException` - if on error occurs while executing the command

    - #### extract

          protected void extract(String appngHome,
                                 CliEnvironment cle,
                                 String applicationDir,
                                 String repositoryPath)
                          throws BusinessException

      Throws:
        `BusinessException`

    - #### copyBatchFileToBin

          protected void copyBatchFileToBin(File binFolder,
                                            String appngData,
                                            String appngHome,
                                            String name)
                                     throws IOException

      Throws:
        `IOException`

    - #### writeContextXml

          protected void writeContextXml(String appngHome)
                                  throws IOException,
                                         URISyntaxException

      Throws:
        `IOException`
        `URISyntaxException`

    - #### setCacheConfig

          protected void setCacheConfig(CliEnvironment cle)

    - #### replaceInFile

          protected static void replaceInFile(File file,
                                              String search,
                                              String replacement)
                                       throws IOException

      Throws:
        `IOException`

Copyright © 2011–2023 aiticon GmbH. All rights reserved.