List<String> read(Object r) throws IOException { out.println(); out.print(currentDomain + "> "); final String l; if (useJline) { l = JLine.readLine(r); } else { l = ((BufferedReader)r).readLine(); history.add(l); } String[] toks = l != null ? l.trim().split(" ") : "bye".split(" "); return getTokens(toks); }
List<String> read(Object r) throws IOException { out.println(); out.print(currentDomain + "> "); final String l; if (useJline) { l = JLine.readLine(r); } else { l = ((BufferedReader)r).readLine(); history.add(l); } String[] toks = l != null ? l.trim().split(" ") : "bye".split(" "); return getTokens(toks); }
boolean run(final String commandsFileURL) throws IOException { BufferedReader r = new BufferedReader(new InputStreamReader(IOHelper.getLocationAsURL(commandsFileURL).openStream())); String l; try { while ((l = r.readLine()) != null) { out.println(l); String[] toks = l != null ? l.trim().split(" ") : "".split(" "); List<String> toksList = getTokens(toks); apply(eval(toksList)); } } finally { r.close(); } return true; }
boolean run(final String commandsFileURL) throws IOException { BufferedReader r = new BufferedReader(new InputStreamReader(IOHelper.getLocationAsURL(commandsFileURL).openStream())); String l; try { while ((l = r.readLine()) != null) { out.println(l); String[] toks = l != null ? l.trim().split(" ") : "".split(" "); List<String> toksList = getTokens(toks); apply(eval(toksList)); } } finally { r.close(); } return true; }