verinec.adaptation
Class DistCP
java.lang.Object
verinec.adaptation.DistCP
- All Implemented Interfaces:
- IDistributor
public class DistCP
- extends Object
- implements IDistributor
Writes files in the local filesystem using java.io.File
todo: support for sudo
- Version:
- $Revision: 939 $
- Author:
- david.buchmann at unifr.ch
|
Method Summary |
void |
distribute(Element config)
Execute the distribution action, that is write the file specified in config to their filename. |
String |
execute(Element command)
Execute a command using verinec.util.ProgramExec |
void |
setTarget(Element target)
Set the target for copy operation. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
prefix
private String prefix
DistCP
public DistCP()
setTarget
public void setTarget(Element target)
- Set the target for copy operation.
There is only the optional attribute prefix path to prepend to the filename.
- Specified by:
setTarget in interface IDistributor
- Parameters:
target - a cp target according to the schema.
distribute
public void distribute(Element config)
throws VerinecException
- Execute the distribution action, that is write the file specified in config to their filename.
- Specified by:
distribute in interface IDistributor
- Parameters:
config - A result-file according to the schema.
- Throws:
VerinecException - If the config is not a result-file or the file can not be written.
execute
public String execute(Element command)
throws VerinecException
- Execute a command using verinec.util.ProgramExec
- Specified by:
execute in interface IDistributor
- Parameters:
command - A command element of the pre- or post-process for the configuration.
- Returns:
- Null if successful, a String containing the error message on failure of the executed program if the command has continueOnError. (Otherwise an execption is thrown on error.)
- Throws:
VerinecException - If the command execution fails (and continueOnError is false) or if the underlying communication protocol fails.