public class LocalExec extends java.lang.Object implements ExecInterface
Constructor and Description |
---|
LocalExec() |
Modifier and Type | Method and Description |
---|---|
void |
addIdentity(java.lang.String identity)
addIdentity, useless for local exec
|
void |
closeConnection() |
int |
copyFrom(java.lang.String sourcePath,
java.util.Collection files,
java.io.File localPath,
boolean recursive)
Copy files from a directory to a local path Input: 'files' is a
Collection of files of type String (!
|
int |
copyFrom(java.lang.String sourcePath,
java.io.File localPath,
boolean recursive)
Copy a local file into a local file Input: 'sfile' of type String (can be
a directory or filename) 'localPath' is either a directory or filename
Only if 'recursive' is set, will directories copied recursively.
|
int |
copyTo(java.util.Collection files,
java.lang.String targetPath,
boolean recursive)
Copy local files to a local/remote directory Input: files is a Collection
of files of type File, targetPath is either a directory in case of
several files, or it is either a dir or filename in case of one single
local file recursive: true if you want traverse directories
|
int |
copyTo(java.io.File lfile,
java.lang.String targetPath,
boolean recursive)
Copy a local file to a local directory/path Input: file of type File
(which can be a directory).
|
boolean |
createDir(java.lang.String dir,
boolean parentflag)
Create a directory given as String parameter.
|
boolean |
deleteFile(java.lang.String fname,
boolean recursive,
boolean allowFileMask)
To be implemented.
|
int |
executeCmd(java.lang.String command,
java.io.OutputStream streamOut,
java.io.OutputStream streamErr)
Execute a command on the local machine 'command' is the full command with
arguments to be executed return: the exit code of the command additional
effects: streamOut is continuously written during execution the stdout of
the command.
|
int |
executeCmd(java.lang.String command,
java.io.OutputStream streamOut,
java.io.OutputStream streamErr,
java.lang.String thirdPartyTarget)
Execute a command externally where the command connects to a third party
and needs to authenticate to that third party.
|
boolean |
openConnection() |
void |
setForcedCleanUp(boolean foo)
Specify if killing of external processes (i.e. clean-up) after error or
timeout is required.
|
void |
setPortForwardingL(java.lang.String spec)
port forwarding not working on local exec
|
void |
setPortForwardingR(java.lang.String spec)
port forwarding not working on local exec
|
void |
setTimeout(int seconds)
Set timeout for the operations.
|
void |
setTimeout(int seconds,
boolean stdout,
boolean stderr)
Set timeout for the operations.
|
public LocalExec()
public void addIdentity(java.lang.String identity)
addIdentity
in interface ExecInterface
public void setPortForwardingL(java.lang.String spec) throws ExecException
setPortForwardingL
in interface ExecInterface
ExecException
public void setPortForwardingR(java.lang.String spec) throws ExecException
setPortForwardingR
in interface ExecInterface
ExecException
public boolean openConnection() throws ExecException
openConnection
in interface ExecInterface
ExecException
public void closeConnection()
closeConnection
in interface ExecInterface
public void setForcedCleanUp(boolean foo)
setForcedCleanUp
in interface ExecInterface
public void setTimeout(int seconds, boolean stdout, boolean stderr)
setTimeout
in interface ExecInterface
public void setTimeout(int seconds)
ExecInterface
setTimeout
in interface ExecInterface
public int executeCmd(java.lang.String command, java.io.OutputStream streamOut, java.io.OutputStream streamErr) throws ExecException
executeCmd
in interface ExecInterface
ExecException
public int executeCmd(java.lang.String command, java.io.OutputStream streamOut, java.io.OutputStream streamErr, java.lang.String thirdPartyTarget) throws ExecException
ExecInterface
executeCmd
in interface ExecInterface
ExecException
public boolean createDir(java.lang.String dir, boolean parentflag) throws ExecException
createDir
in interface ExecInterface
ExecException
public boolean deleteFile(java.lang.String fname, boolean recursive, boolean allowFileMask) throws ExecException
deleteFile
in interface ExecInterface
ExecException
public int copyTo(java.util.Collection files, java.lang.String targetPath, boolean recursive) throws ExecException
copyTo
in interface ExecInterface
ExecException
public int copyTo(java.io.File lfile, java.lang.String targetPath, boolean recursive) throws ExecException
copyTo
in interface ExecInterface
ExecException
public int copyFrom(java.lang.String sourcePath, java.util.Collection files, java.io.File localPath, boolean recursive) throws ExecException
copyFrom
in interface ExecInterface
ExecException
public int copyFrom(java.lang.String sourcePath, java.io.File localPath, boolean recursive) throws ExecException
copyFrom
in interface ExecInterface
ExecException