Interface OSUtils

  • All Known Implementing Classes:
    CliTokenSource

    public interface OSUtils
    OSUtils is an interface that provides utility methods for determining the current operating system and returning executable command based on the operating system.
    • Method Detail

      • getOS

        default String getOS()
        Returns the name of the current operating system.
        Returns:
        a String representing the name of the current operating system. The value will be "win" for Windows, "mac" for macOS, and "linux" for Linux-based operating systems.
      • getCliExecutableCommand

        default List<String> getCliExecutableCommand​(List<String> cmd)
        Returns a list of strings representing an executable command for the current operating system, based on the given list of command tokens.
        Parameters:
        cmd - a list of strings representing the command to be executed.
        Returns:
        a List of strings representing the executable command for the current operating system. On Windows, the command will be wrapped in "cmd.exe /c" and on other operating systems, it will be wrapped in "/bin/bash -c".