Class OSGiConsole

java.lang.Object
org.openhab.core.io.console.karaf.OSGiConsole
All Implemented Interfaces:
Console

@NonNullByDefault public class OSGiConsole extends Object implements Console
Author:
Markus Rathgeb - Initial contribution
  • Constructor Details

    • OSGiConsole

      public OSGiConsole(String scope, PrintStream out, org.apache.karaf.shell.api.console.Session session)
  • Method Details

    • printf

      public void printf(String format, Object... args)
      Specified by:
      printf in interface Console
    • print

      public void print(String s)
      Specified by:
      print in interface Console
    • println

      public void println(String s)
      Specified by:
      println in interface Console
    • printUsage

      public void printUsage(String s)
      Description copied from interface: Console
      usage output is treated differently from other output as it might differ between different kinds of consoles
      Specified by:
      printUsage in interface Console
      Parameters:
      s - the main usage string (console independent)
    • readLine

      public String readLine(String prompt, @Nullable Character mask) throws IOException
      Description copied from interface: Console
      Reads a line from the console. The prompt is displayed before the line is read.
      Specified by:
      readLine in interface Console
      Parameters:
      prompt - the prompt to display
      mask - the character to use for masking input (e.g. '*'), or null if no masking is required
      Returns:
      the line read from the console
      Throws:
      IOException - if an I/O error occurs
    • getSession

      public org.apache.karaf.shell.api.console.Session getSession()