Class SHAFT.CLI

java.lang.Object
com.shaft.driver.SHAFT.CLI
Enclosing class:
SHAFT

public static class SHAFT.CLI extends Object
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 Details

    • terminal

      public static TerminalActions terminal()
      Creates a new terminal actions instance for executing shell commands.
      Returns:
      a TerminalActions instance
    • 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 until TerminalActions.quit() is called.
      Parameters:
      sshHostName - the IP address or host name for the remote machine
      sshPortNumber - the SSH service port on the target machine
      sshUsername - the username used to access the target machine
      sshKeyFileFolderName - the directory that holds the SSH key file
      sshKeyFileName - the SSH key file name
      Returns:
      a reusable remote TerminalActions instance
    • file

      public static FileActions file()
      Creates a new file actions instance for file-system operations.
      Returns:
      a FileActions instance