private static URL argumentToInput(String arg) throws MalformedURLException { final File witnessFile = new File(arg); if (witnessFile.exists()) { return witnessFile.toURI().normalize().toURL(); } else { return new URL(arg); } }
private static InputStream argumentToInputStream(String arg) throws MalformedURLException, IOException { if ("-".equals(arg)) { return System.in; } final File witnessFile = new File(arg); if (witnessFile.exists()) { return witnessFile.toURI().normalize().toURL().openStream(); } else { return new URL(arg).openStream(); } }