private static MemoryHistory getHistory() { String historyFilePath = System.getenv("PRESTO_HISTORY_FILE"); File historyFile; if (isNullOrEmpty(historyFilePath)) { historyFile = new File(getUserHome(), ".presto_history"); } else { historyFile = new File(historyFilePath); } return getHistory(historyFile); }
protected File getUserHome() { return Configuration.getUserHome(); }
/** * Retrieve the URL for the inputrc configuration file in effect. Intended * use is for instantiating ConsoleKeys, to read inputrc variables. */ public static URL getInputRc() throws IOException { String path = Configuration.getString(JLINE_INPUTRC); if (path == null) { File f = new File(Configuration.getUserHome(), INPUT_RC); if (!f.exists()) { f = new File(DEFAULT_INPUT_RC); } return f.toURI().toURL(); } else { return Urls.create(path); } }
private static URL determineUrl() { // See if user has customized the configuration location via sysprop String tmp = System.getProperty(JLINE_CONFIGURATION); if (tmp != null) { return Urls.create(tmp); } else { // Otherwise try the default File file = new File(getUserHome(), JLINE_RC); return Urls.create(file); } }
reader.setHistory(new FileHistory(new File(Configuration.getUserHome(), String.format(".jline-%s.%s.history", mainClass, historyFileName)))); reader.setHistory(new FileHistory(new File(Configuration.getUserHome(), String.format(".jline-%s.history", mainClass))));
protected File getUserHome() { return Configuration.getUserHome(); }
private static MemoryHistory getHistory() { String historyFilePath = System.getenv("PRESTO_HISTORY_FILE"); File historyFile; if (isNullOrEmpty(historyFilePath)) { historyFile = new File(getUserHome(), ".presto_history"); } else { historyFile = new File(historyFilePath); } return getHistory(historyFile); }
private static MemoryHistory getHistory() { String historyFilePath = System.getenv("PRESTO_HISTORY_FILE"); File historyFile; if (isNullOrEmpty(historyFilePath)) { historyFile = new File(getUserHome(), ".presto_history"); } else { historyFile = new File(historyFilePath); } return getHistory(historyFile); }
private static MemoryHistory getHistory() { String historyFilePath = System.getenv("PRESTO_HISTORY_FILE"); File historyFile; if (isNullOrEmpty(historyFilePath)) { historyFile = new File(getUserHome(), ".presto_history"); } else { historyFile = new File(historyFilePath); } return getHistory(historyFile); }
private static URL getInputRc() throws IOException { String path = Configuration.getString(JLINE_INPUTRC); if (path == null) { File f = new File(Configuration.getUserHome(), INPUT_RC); if (!f.exists()) { f = new File(DEFAULT_INPUT_RC); } return f.toURI().toURL(); } else { return Urls.create(path); } }
private static URL determineUrl() { // See if user has customized the configuration location via sysprop String tmp = System.getProperty(JLINE_CONFIGURATION); if (tmp != null) { return Urls.create(tmp); } else { // Otherwise try the default File file = new File(getUserHome(), JLINE_RC); return Urls.create(file); } }
private static MemoryHistory getHistory() { MemoryHistory history; File historyFile = new File(getUserHome(), ".presto_history"); try { history = new FileHistory(historyFile); history.setMaxSize(10000); } catch (IOException e) { System.err.printf("WARNING: Failed to load history file (%s): %s. " + "History will not be available during this session.%n", historyFile, e.getMessage()); history = new MemoryHistory(); } history.setAutoTrim(true); return history; }
reader.setHistory(new FileHistory(new File(Configuration.getUserHome(), String.format(".jline-%s.%s.history", mainClass, historyFileName)))); reader.setHistory(new FileHistory(new File(Configuration.getUserHome(), String.format(".jline-%s.history", mainClass))));