Class AbstractOperatingSystemWrapper

    • Constructor Detail

      • AbstractOperatingSystemWrapper

        protected AbstractOperatingSystemWrapper()
        Construct a wrapper.
    • Method Detail

      • runCommand

        protected static String runCommand​(String... command)
        Run a shell command.
        Parameters:
        command - is the shell command to run.
        Returns:
        the standard output
      • grep

        protected static String grep​(String selector,
                                     String text)
        Replies the first line that contains the given selector.
        Parameters:
        selector - is the string to search for.
        text - is the text to search in.
        Returns:
        the found line or null.
      • cut

        protected static String cut​(String delimiter,
                                    int column,
                                    String lineText)
        Cut the line in columns and replies the given column.
        Parameters:
        delimiter - is the delmiter to use to cut.
        column - is the number of the column to reply.
        lineText - is the line to cut.
        Returns:
        the column or null.