public static URL create(final String input) { if (input == null) { return null; } try { return new URL(input); } catch (MalformedURLException e) { return create(new File(input)); } }
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); } }
/** * 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); } }
public static URL create(final String input) { if (input == null) { return null; } try { return new URL(input); } catch (MalformedURLException e) { return create(new File(input)); } }
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 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); } }