示例#1
0
 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);
   }
 }
示例#2
0
 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();
   }
 }