@Override public synchronized void flush() { try { if (jline) { reader.print(ConsoleReader.RESET_LINE + ""); reader.flush(); super.flush(); try { reader.drawLine(); } catch (Throwable ex) { reader.getCursorBuffer().clear(); } reader.flush(); } else { super.flush(); } } catch (IOException ex) { logger.log(Level.SEVERE, "I/O exception flushing console output", ex); } } }
public void println(final CharSequence s) throws IOException { print(s); println(); }
reader.print(Messages.DISPLAY_CANDIDATES.format(distinct.size())); reader.flush();
String nextPrompt = repeat("-", numdashes) + prompt + repeat("-", numdashes); lastPromptLength = nextPrompt.length(); reader.print(nextPrompt); reader.flush();
@Override public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) { final ConsoleReader reader = shellState.getReader(); AccumuloVFSClassLoader.printClassPath(s -> { try { reader.print(s); } catch (IOException ex) { throw new RuntimeException(ex); } }, true); return 0; }
public void printVerboseInfo() throws IOException { StringBuilder sb = new StringBuilder("-\n"); sb.append("- Current user: ").append(accumuloClient.whoami()).append("\n"); if (execFile != null) sb.append("- Executing commands from: ").append(execFile).append("\n"); if (disableAuthTimeout) sb.append("- Authorization timeout: disabled\n"); else sb.append("- Authorization timeout: ") .append(String.format("%ds%n", TimeUnit.NANOSECONDS.toSeconds(authTimeout))); sb.append("- Debug: ").append(isDebuggingEnabled() ? "on" : "off").append("\n"); if (!scanIteratorOptions.isEmpty()) { for (Entry<String,List<IteratorSetting>> entry : scanIteratorOptions.entrySet()) { sb.append("- Session scan iterators for table ").append(entry.getKey()).append(":\n"); for (IteratorSetting setting : entry.getValue()) { sb.append("- Iterator ").append(setting.getName()).append(" options:\n"); sb.append("- ").append("iteratorPriority").append(" = ") .append(setting.getPriority()).append("\n"); sb.append("- ").append("iteratorClassName").append(" = ") .append(setting.getIteratorClass()).append("\n"); for (Entry<String,String> optEntry : setting.getOptions().entrySet()) { sb.append("- ").append(optEntry.getKey()).append(" = ") .append(optEntry.getValue()).append("\n"); } } } } sb.append("-\n"); reader.print(sb.toString()); }
shellState.getReader().print("System permissions: "); for (SystemPermission p : SystemPermission.values()) { if (p != null && shellState.getAccumuloClient().securityOperations().hasSystemPermission(user, p)) { shellState.getReader().print(delim + "System." + p.name()); delim = ", "; .hasNamespacePermission(user, n, p)) { if (runOnce) { shellState.getReader().print("\nNamespace permissions (" + n + "): "); runOnce = false; shellState.getReader().print(delim + "Namespace." + p.name()); delim = ", "; && p != null) { if (runOnce) { shellState.getReader().print("\nTable permissions (" + t + "): "); runOnce = false; shellState.getReader().print(delim + "Table." + p.name()); delim = ", ";
shellState.getReader().print(sb.toString());
@Override public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) throws IOException { // custom clear screen, so I don't have to redraw the prompt twice if (!shellState.getReader().getTerminal().isAnsiSupported()) { throw new IOException("Terminal does not support ANSI commands"); } // send the ANSI code to clear the screen shellState.getReader().print(((char) 27) + "[2J"); shellState.getReader().flush(); // then send the ANSI code to go to position 1,1 shellState.getReader().print(((char) 27) + "[1;1H"); shellState.getReader().flush(); return 0; }
public void printInfo() throws IOException { ClientInfo info = ClientInfo.from(accumuloClient.properties()); reader.print("\n" + SHELL_DESCRIPTION + "\n" + "- \n" + "- version: " + Constants.VERSION + "\n" + "- instance name: " + info.getInstanceName() + "\n" + "- instance id: " + accumuloClient.getInstanceID() + "\n" + "- \n" + "- type 'help' for a list of available commands\n" + "- \n"); reader.flush(); }
public void print(String s) { for ( ChatColor color : colors ) { s = s.replaceAll( "(?i)" + color.toString(), replacements.get( color ) ); } try { console.print( Ansi.ansi().eraseLine( Erase.ALL ).toString() + ConsoleReader.RESET_LINE + s + Ansi.ansi().reset().toString() ); console.drawLine(); console.flush(); } catch ( IOException ex ) { } }
print(resources.getString("DISPLAY_MORE")); flush(); int c = readCharacter();
.print(String.format("[%s] %s%n", delete ? "DELETED" : "SKIPPED", entryStr)); } catch (IOException e) { log.error("Cannot write to console", e);
private void print(String string) { try { console.print(string); } catch (IOException e) { throw new RuntimeException(e); } } }
private void print0(String template, Object... args) { try { console.print(S.fmt(template, args)); } catch (IOException e) { throw E.ioException(e); } }
private void print0(String template, Object... args) { try { console.print(S.fmt(template, args)); } catch (IOException e) { throw E.ioException(e); } }
void printLine( String line ) throws IOException { console.redrawLine(); console.print( line ); console.flush(); } }
public void printInfo() throws IOException { reader.print("\n" + SHELL_DESCRIPTION + "\n" + "- \n" + "- version: " + Constants.VERSION + "\n" + "- instance name: " + connector.getInstance().getInstanceName() + "\n" + "- instance id: " + connector.getInstance().getInstanceID() + "\n" + "- \n" + "- type 'help' for a list of available commands\n" + "- \n"); reader.flush(); }