protected void parseInfoCmp() { String capabilities = null; if (type != null) { try { capabilities = InfoCmp.getInfoCmp(type); } catch (Exception e) { Log.warn("Unable to retrieve infocmp for type " + type, e); } } if (capabilities == null) { capabilities = InfoCmp.getLoadedInfoCmp("ansi"); } InfoCmp.parseInfoCmp(capabilities, bools, ints, strings); }
public static Capability byName(String name) { return getCapabilitiesByName().get(name); } }
public KarafTerminal(Terminal terminal) throws IOException { super("Karaf", terminal.getType()); this.terminal = terminal; String type = terminal.getType(); if (type == null && terminal.isAnsiSupported()) { type = "ansi"; } String caps; try { caps = InfoCmp.getInfoCmp(type); } catch (Exception e) { try { caps = InfoCmp.getInfoCmp("ansi"); } catch (InterruptedException e2) { throw new UnsupportedOperationException(e2); } } try { InfoCmp.parseInfoCmp(caps, bools, ints, strings); } catch (Exception e) { // TODO } }
public static String getInfoCmp( String terminal ) throws IOException, InterruptedException { String caps = getLoadedInfoCmp(terminal); if (caps == null) { Process p = new ProcessBuilder(OSUtils.INFOCMP_COMMAND, terminal).start(); caps = ExecHelper.waitAndCapture(p); CAPS.put(terminal, caps); } return caps; }
public KarafTerminal(Terminal terminal) throws IOException { super("Karaf", terminal.getType()); this.terminal = terminal; String type = terminal.getType(); if (type == null && terminal.isAnsiSupported()) { type = "ansi"; } String caps; try { caps = InfoCmp.getInfoCmp(type); } catch (Exception e) { try { caps = InfoCmp.getInfoCmp("ansi"); } catch (InterruptedException e2) { throw new UnsupportedOperationException(e2); } } try { InfoCmp.parseInfoCmp(caps, bools, ints, strings); } catch (Exception e) { // TODO } }
public String[] getNames() { return getCapabilitiesByName().entrySet().stream() .filter(e -> e.getValue() == this) .map(Map.Entry::getValue) .toArray(String[]::new); }
Map<Capability, String> strings ) { Map<String, Capability> capsByName = getCapabilitiesByName(); String[] lines = capabilities.split("\n"); for (int i = 1; i < lines.length; i++) {