Package net.shibboleth.idp.installer
Class CopyDistribution
- java.lang.Object
-
- net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
-
- net.shibboleth.idp.installer.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 Summary
Fields Modifier and Type Field Description private InstallerPropertiesinstallerPropsProperties for the job.private CurrentInstallStateinstallStateThe state of the current install.private org.slf4j.LoggerlogLog.
-
Constructor Summary
Constructors Constructor Description CopyDistribution(InstallerProperties props, CurrentInstallState state)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcopyBinDocSystem()Populate the per distribution (but non dist) folders.protected voidcopyDist()Populate the dist folder.private voiddelete(Path what, String excludes)Helper for thedeleteOld()method.protected voiddeleteOld()Delete old copies of bin/lib (leaving bin for scripts), disty, doc and system.private voiddistCopy(Path srcDist, Path dist, String to)Helper for thecopyDist()andcopyBinDocSystem()methods.private voiddistCopy(Path srcDist, Path dist, String to, boolean overwrite)Helper for thecopyDist()andcopyBinDocSystem()methods.voidexecute()Copy the distribution from the dstribution to their new locations, having first taken a backup.-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, doDestroy, doInitialize, initialize, isDestroyed, isInitialized
-
-
-
-
Field Detail
-
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 Detail
-
CopyDistribution
public CopyDistribution(@Nonnull InstallerProperties props, @Nonnull CurrentInstallState state)Constructor.- Parameters:
props- The environment for the work.state- Where we are right now.
-
-
Method Detail
-
execute
public void execute() throws org.apache.tools.ant.BuildExceptionCopy 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 thedeleteOld()method.- Parameters:
what- what to deleteexcludes- 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 thecopyDist()andcopyBinDocSystem()methods.- Parameters:
srcDist- the source distribution.dist- the dist directoryto- the subfolder nameoverwrite- 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 thecopyDist()andcopyBinDocSystem()methods.- Parameters:
srcDist- the source distribution.dist- the dist directoryto- 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
-
-