Class OSGiConsole
java.lang.Object
org.openhab.core.io.console.karaf.OSGiConsole
- All Implemented Interfaces:
Console
- Author:
- Markus Rathgeb - Initial contribution
-
Constructor Summary
ConstructorsConstructorDescriptionOSGiConsole(String scope, PrintStream out, org.apache.karaf.shell.api.console.Session session) -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.karaf.shell.api.console.Session@Nullable StringgetUser()Returns the user name associated with the console, or null if no user is associated.voidPrints a string to the console without appending a newline.voidPrints formatted output to the console.voidPrints a string to the console followed by a newline.voidprintUsage(String s) usage output is treated differently from other output as it might differ between different kinds of consolesReads a line from the console.
-
Constructor Details
-
OSGiConsole
public OSGiConsole(String scope, PrintStream out, org.apache.karaf.shell.api.console.Session session)
-
-
Method Details
-
printf
Description copied from interface:ConsolePrints formatted output to the console. This method formats the given string using the specified arguments and prints it to the console without appending a newline.- Specified by:
printfin interfaceConsole- Parameters:
format- the format string (followingString.format(java.lang.String, java.lang.Object...)syntax)args- the arguments referenced by the format specifiers in the format string
-
print
Description copied from interface:ConsolePrints a string to the console without appending a newline. -
println
Description copied from interface:ConsolePrints a string to the console followed by a newline. -
printUsage
Description copied from interface:Consoleusage output is treated differently from other output as it might differ between different kinds of consoles- Specified by:
printUsagein interfaceConsole- Parameters:
s- the main usage string (console independent)
-
readLine
Description copied from interface:ConsoleReads a line from the console. The prompt is displayed before the line is read.- Specified by:
readLinein interfaceConsole- Parameters:
prompt- the prompt to displaymask- 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
-
getUser
Description copied from interface:ConsoleReturns the user name associated with the console, or null if no user is associated. -
getSession
public org.apache.karaf.shell.api.console.Session getSession()
-