Class CopyDistribution

All Implemented Interfaces:
Component, DestructableComponent, InitializableComponent

public final class CopyDistribution
extends AbstractInitializableComponent
Copy the distribution to the final location. Prior to doing so take a backup of the old distribution. "The final location" means the dist, doc and system subdirectories.
  • Field Details

    • log

      private final org.slf4j.Logger log
      Log.
    • installerProps

      @Nonnull private final InstallerProperties installerProps
      Properties for the job.
    • installState

      @Nonnull private final CurrentInstallState installState
      The state of the current install.
  • Constructor Details

    • CopyDistribution

      public CopyDistribution​(@Nonnull InstallerProperties props, @Nonnull CurrentInstallState state)
      Constructor.
      Parameters:
      props - The environment for the work.
      state - Where we are right now.
  • Method Details

    • execute

      public void execute() throws org.apache.tools.ant.BuildException
      Copy the distribution from the dstribution to their new locations, having first taken a backup.
      Throws:
      org.apache.tools.ant.BuildException - if badness occurs
    • delete

      private void delete​(Path what, String excludes)
      Helper for the deleteOld() method.
      Parameters:
      what - what to delete
      excludes - what to exclude
    • deleteOld

      protected void deleteOld()
      Delete old copies of bin/lib (leaving bin for scripts), disty, doc and system. system has to be unprotected first which also means we need to create it too.
      Throws:
      org.apache.tools.ant.BuildException - if badness occurs
    • distCopy

      private void distCopy​(Path srcDist, Path dist, String to, boolean overwrite) throws org.apache.tools.ant.BuildException
      Helper for the copyDist() and copyBinDocSystem() methods.
      Parameters:
      srcDist - the source distribution.
      dist - the dist directory
      to - the subfolder name
      overwrite - whether we want to overwrite
      Throws:
      org.apache.tools.ant.BuildException - if badness occurs
    • distCopy

      private void distCopy​(Path srcDist, Path dist, String to) throws org.apache.tools.ant.BuildException
      Helper for the copyDist() and copyBinDocSystem() methods.
      Parameters:
      srcDist - the source distribution.
      dist - the dist directory
      to - the subfolder name
      Throws:
      org.apache.tools.ant.BuildException - if badness occurs
    • copyDist

      protected void copyDist()
      Populate the dist folder.
      Throws:
      org.apache.tools.ant.BuildException - if badness occurs
    • copyBinDocSystem

      protected void copyBinDocSystem()
      Populate the per distribution (but non dist) folders.
      Throws:
      org.apache.tools.ant.BuildException - if badness occurs