]> gitweb.hhaalo.de Git - discspan-java.git/commitdiff
add: check input file exists
authorBastian Dehn <hhaalo@arcor.de>
Thu, 3 Feb 2022 16:36:19 +0000 (17:36 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Thu, 3 Feb 2022 16:36:19 +0000 (17:36 +0100)
src/de/hhaalo/discspan.java

index 8ba0895e51708539a1477cf7d809e99221dc204a..da1b49919ef7f29f4fd98d35dbc84e82b0fecd80 100644 (file)
@@ -1,5 +1,7 @@
 package de.hhaalo.discspan;
 
+import java.io.File;
+
 public class discspan
 {
        public static void main(String[] args)
@@ -12,5 +14,11 @@ public class discspan
                        System.err.println("ERROR: missing arguments");
                        System.exit(1);
                }
+
+               File inputFile = new File(param.getInput());
+               if (!inputFile.exists()) {
+                       System.err.println("ERROR: " + param.getInput()
+                                       + " file does not exists");
+               }
        }
 }