|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface CmdLineExecutor
The object that connects to the target machine, executes the commands and returns the results.
Method Summary | |
---|---|
void |
close()
Close the connection to the target |
Entry |
executeCommand(java.lang.String cmd)
Execute the command on the target machine. |
Entry |
executeCommand(java.lang.String cmd,
java.lang.String[] args,
java.lang.String argDelimiter)
Execute the command on the target machine. |
char |
getOSSeparator()
Return the correct path separator for the target system. |
java.lang.String |
getRandomDir(java.lang.String path)
Create a random directory on the target machine. |
boolean |
prepareConnection()
Create a connection with the target machine |
void |
removeDir(java.lang.String dirPath)
Remove a file/directory from the target |
void |
setExecutorCmdArgsEncoding(java.lang.String enc)
Sets encoding for the command arguments before executing the actual command |
void |
transferFile(java.lang.String localStdin,
java.lang.String remoteStdin)
Transfer file localStdin to remoteStdin. |
Method Detail |
---|
Entry executeCommand(java.lang.String cmd) throws GeneralCLFCException
cmd
- The command to be executed
GeneralCLFCException
- When an exception occurs trying to execute the command
remotely.Entry executeCommand(java.lang.String cmd, java.lang.String[] args, java.lang.String argDelimiter) throws GeneralCLFCException
cmd
- The command to be executedargs
- The command arguments as a String ArrayargDelimiter
- The command argument delimiter
GeneralCLFCException
- When an exception occurs trying to execute the command
remotely.boolean prepareConnection() throws GeneralCLFCException
GeneralCLFCException
java.lang.String getRandomDir(java.lang.String path) throws GeneralCLFCException
path
- The path to the directory under which the random directory is
to be created
GeneralCLFCException
- If random directory creation failsvoid transferFile(java.lang.String localStdin, java.lang.String remoteStdin) throws GeneralCLFCException
localStdin
- Path to standard input source file on local machineremoteStdin
- Path to standard input destination file on target machine
GeneralCLFCException
- If file transfer is unsuccessfulvoid removeDir(java.lang.String dirPath) throws GeneralCLFCException
dirPath
- Path to the file/folder to be removed on target machine
GeneralCLFCException
- If delete operation is unsuccessfulchar getOSSeparator() throws GeneralCLFCException
GeneralCLFCException
- If problems encountered obtaining the OS Separator.void close()
void setExecutorCmdArgsEncoding(java.lang.String enc)
enc
- encoding to be used
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |