code: public static boolean checkArgs(String[] args) {        
          if (args.length < 4) {
              return false;
          }
          
          if (args[0].compareToIgnoreCase("-modeldir") != 0) {
              return false;
          }
          
          if (!(args[2].compareToIgnoreCase("-inputfile") == 0 ||
                  args[2].compareToIgnoreCase("-inputdir") == 0)) {
              return false;
          }
          
          return true;
      }
docs: Check args.
  
  @param args the args
  @return true, if successful