com.xebialabs.deployit.steps
Class CopyStep

java.lang.Object
  extended by com.xebialabs.deployit.steps.HostSessionStep
      extended by com.xebialabs.deployit.steps.CopyStep
All Implemented Interfaces:
Step, java.io.Serializable

public class CopyStep
extends HostSessionStep

Steps that copies files and directories from one host to another.

See Also:
Serialized Form

Field Summary
protected  Host destinationHost
           
protected  java.lang.String destinationLocation
           
protected  java.util.Map<java.lang.String,java.lang.String> properties
           
protected  java.lang.String sourceLocation
           
 
Fields inherited from class com.xebialabs.deployit.steps.HostSessionStep
description, host
 
Constructor Summary
CopyStep(Host sourceHost, java.lang.String sourceLocation, Host destinationHost, java.lang.String destinationLocation)
          Creates a new CopyStep that will not create a top-level directory and that will do no placeholder replacement.
CopyStep(Host sourceHost, java.lang.String sourceLocation, Host destinationHost, java.lang.String destinationLocation, java.util.Map<java.lang.String,java.lang.String> properties)
          Creates a new CopyStep that copies a file from a location on a source host to a location on a destination host, replacing placeholders in the source file using the given properties.
 
Method Summary
 boolean execute(StepExecutionContext ctx)
           
 
Methods inherited from class com.xebialabs.deployit.steps.HostSessionStep
getDescription, getHostSession, setDescription
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sourceLocation

protected java.lang.String sourceLocation

destinationLocation

protected java.lang.String destinationLocation

destinationHost

protected Host destinationHost

properties

protected java.util.Map<java.lang.String,java.lang.String> properties
Constructor Detail

CopyStep

public CopyStep(Host sourceHost,
                java.lang.String sourceLocation,
                Host destinationHost,
                java.lang.String destinationLocation)
Creates a new CopyStep that will not create a top-level directory and that will do no placeholder replacement.

See Also:
CopyStep#CopyStep(Host, String, Host, String, boolean, Map)

CopyStep

public CopyStep(Host sourceHost,
                java.lang.String sourceLocation,
                Host destinationHost,
                java.lang.String destinationLocation,
                java.util.Map<java.lang.String,java.lang.String> properties)
Creates a new CopyStep that copies a file from a location on a source host to a location on a destination host, replacing placeholders in the source file using the given properties. Placeholder replacement is strict, meaning that any if any placeholders in the source file cannot be replaced (i.e. no corresponding value is found) an error is thrown.

Assumes that the source file is a text file, not a directory or other type of file that cannot be read into a string.

Parameters:
sourceHost - the source host
sourceLocation - the location on the source host
destinationHost - the destination host
destinationLocation - the location on the destination host
createToplevelDirectory - indicates if the top-level directory should be created if non-existent
properties - the properties to be used for placeholder replacement
Method Detail

execute

public boolean execute(StepExecutionContext ctx)
Parameters:
ctx - Context info required to execute the step.
Returns:
execution successful or failed.


Copyright © 2010. All Rights Reserved.