client); ConsoleReader reader = new ConsoleReader(); String line; while ((line = reader.readLine(PROMPT_MESSAGE)) != null) {
.build(); ConsoleReader reader = new ConsoleReader(); String line; while ((line = reader.readLine(PROMPT_MESSAGE)) != null) {
RRMultiWriter<Integer, String> writer = new RRMultiWriter(streamNameList, client); ConsoleReader reader = new ConsoleReader(); String line; while ((line = reader.readLine(PROMPT_MESSAGE)) != null) {
.build(); ConsoleReader reader = new ConsoleReader(); String line; while ((line = reader.readLine(PROMPT_MESSAGE)) != null) {
writer = FutureUtils.result(dlm.openAsyncLogWriter()); ConsoleReader reader = new ConsoleReader(); String line; while ((line = reader.readLine(PROMPT_MESSAGE)) != null) {
private ConsoleReader createAnsiWindowsReader() throws Exception { // Get decorated OutputStream that parses ANSI-codes final PrintStream ansiOut = (PrintStream) ClassUtils .getClass(JLineShell.class.getClassLoader(), ANSI_CONSOLE_CLASSNAME).getMethod("out") .invoke(null); final WindowsTerminal ansiTerminal = new WindowsTerminal() { @Override public boolean isANSISupported() { return true; } }; ansiTerminal.initializeTerminal(); // Make sure to reset the original shell's colors on shutdown by closing // the stream statusListener = new ShellStatusListener() { public void onShellStatusChange(final ShellStatus oldStatus, final ShellStatus newStatus) { if (newStatus.getStatus().equals(Status.SHUTTING_DOWN)) { ansiOut.close(); } } }; addShellStatusListener(statusListener); return new ConsoleReader(new FileInputStream(FileDescriptor.in), new PrintWriter( new OutputStreamWriter(ansiOut, // Default to Cp850 encoding for Windows console output // (ROO-439) System.getProperty("jline.WindowsTerminal.output.encoding", "Cp850"))), null, ansiTerminal); }
reader = new ConsoleReader();
private static ConsoleReader getConsoleReader() throws IOException { if (reader == null) reader = new ConsoleReader(); return reader; }
public ConsoleInputHandler() { if(null == console) { try { this.jline = new ConsoleReader(); } catch (IOException e) { this.jline = null; } } }
public static String readPassword() { try { System.out.print("Enter password: "); return new jline.ConsoleReader().readLine(Character.valueOf('*')); } catch (Exception e) { throw new RuntimeException(e); } }
public static String readPassword() { try { System.out.print("Enter password: "); return new jline.ConsoleReader().readLine(Character.valueOf('*')); } catch (Exception e) { throw new RuntimeException(e); } }
public ConsoleReader createConsoleReader() throws IOException { return new ConsoleReader( inputStream, new PrintWriter(outputStream, true), null, // bindings getTerminal()); } }
/** * Sets up the JLine console reader. * * @return A JLine console reader. * * @throws IOException If an IO error is encountered while reading the input. */ private ConsoleReader initializeCommandLineReader() throws IOException { ConsoleReader reader = new ConsoleReader(); reader.setBellEnabled(false); return reader; }
public PromptReader(final IO io) throws IOException { assert io != null; this.reader = new ConsoleReader(io.inputStream, new PrintWriter(io.outputStream, true), /*bindings*/ null, io.getTerminal()); }
/** * Heper method to read the password from Jline cmd * * @param prompt The prompt to request password * @return Password */ private String readPassword(String prompt) { ConsoleReader reader; try { reader = new ConsoleReader(); Character mask = 0; return reader.readLine(prompt, mask); } catch (IOException ignored) { } return null; } }
public CliWriter() { try { terminal = Terminal.setupTerminal(); reader = new ConsoleReader(); terminal.beforeReadLine(reader, "", (char) 0); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException(e); } }
public void setCygwinTerminal() { try { this.jline = new ConsoleReader(new FileInputStream(FileDescriptor.in) ,new PrintWriter( new OutputStreamWriter(System.out, System.getProperty("jline.WindowsTerminal.output.encoding", System.getProperty("file.encoding")))) ,null ,new UnixTerminal()); } catch (IOException e) { this.jline = null; } }
private ShellExecutionThread(String username, String password, String mock) throws IOException { this.done = false; this.cmd = null; this.cmdIndex = 0; this.readWait = false; this.output = new StringBuilderOutputStream(); ConsoleReader reader = new ConsoleReader(this, new OutputStreamWriter(output, UTF_8)); this.shell = new Shell(reader, new PrintWriter(new OutputStreamWriter(output, UTF_8))); shell.setLogErrorsToConsole(); if (mock != null) { if (shell.config("--fake", "-u", username, "-p", password)) throw new IOException("mock shell config error"); } else if (shell.config("-u", username, "-p", password)) { throw new IOException("shell config error"); } }
public ConsoleProgressMonitorImpl() throws IOException { terminal = Terminal.setupTerminal(); reader = new ConsoleReader(); terminal.beforeReadLine(reader, "", (char) 0); }
protected static void initReadline(Ruby runtime, ConsoleHolder holder) throws IOException { holder.readline = new ConsoleReader(); holder.readline.setUseHistory(false); holder.readline.setUsePagination(true); holder.readline.setBellEnabled(false); ((CandidateListCompletionHandler) holder.readline.getCompletionHandler()).setAlwaysIncludeNewline(false); if (holder.currentCompletor == null) { holder.currentCompletor = new RubyFileNameCompletor(); } holder.readline.addCompletor(holder.currentCompletor); holder.readline.setHistory(holder.history); }