Class SHAFT.CLI
java.lang.Object
com.shaft.driver.SHAFT.CLI
- Enclosing class:
SHAFT
Provides access to command-line and file-system operations.
Usage example:
SHAFT.CLI.terminal().performTerminalCommand("echo hello");
SHAFT.CLI.file().readFile("path/to/file.txt");
-
Method Summary
Modifier and TypeMethodDescriptionstatic FileActionsfile()Creates a new file actions instance for file-system operations.static TerminalActionsremoteTerminal(String sshHostName, int sshPortNumber, String sshUsername, String sshKeyFileFolderName, String sshKeyFileName) Creates a new remote terminal actions instance that reuses one SSH session across multiple command executions untilTerminalActions.quit()is called.static TerminalActionsterminal()Creates a new terminal actions instance for executing shell commands.
-
Method Details
-
terminal
Creates a new terminal actions instance for executing shell commands.- Returns:
- a
TerminalActionsinstance
-
remoteTerminal
public static TerminalActions remoteTerminal(String sshHostName, int sshPortNumber, String sshUsername, String sshKeyFileFolderName, String sshKeyFileName) Creates a new remote terminal actions instance that reuses one SSH session across multiple command executions untilTerminalActions.quit()is called.- Parameters:
sshHostName- the IP address or host name for the remote machinesshPortNumber- the SSH service port on the target machinesshUsername- the username used to access the target machinesshKeyFileFolderName- the directory that holds the SSH key filesshKeyFileName- the SSH key file name- Returns:
- a reusable remote
TerminalActionsinstance
-
file
Creates a new file actions instance for file-system operations.- Returns:
- a
FileActionsinstance
-