Source:
<code>private boolean parseKeywords(String[] args, int i) throws Exception { boolean result = false; if (checkPair(args, NEW_SESSION, i)) { result = true; } else if (checkPair(args, SESSION, i)) { result = true; } else if (checkPair(args, DIR, i)) { Constant.setZapHome(keywords.get(DIR)); result = true; } else if (checkPair(args, INSTALL_DIR, i)) { Constant.setZapInstall(keywords.get(INSTALL_DIR)); result = true; } else if (checkPair(args, HOST, i)) { this.host = keywords.get(HOST); result = true; } else if (checkPair(args, PORT, i)) { this.port = Integer.parseInt(keywords.get(PORT)); result = true; } else if (checkPair(args, CONFIG, i)) { String pair = keywords.get(CONFIG); if (pair != null && pair.indexOf("=") > 0) { int eqIndex = pair.indexOf("="); this.configs.put(pair.substring(0, eqIndex), pair.substring(eqIndex + 1)); result = true; } } else if (checkPair(args, CONFIG_FILE, i)) { String conf = keywords.get(CONFIG_FILE); File confFile = new File(conf); <START> if (! confFile.exists()) { <END> String error = "No such file: " + confFile.getAbsolutePath(); System.out.println(error); throw new Exception(error); } else if (! confFile.canRead()) { String error = "File not readable: " + confFile.getAbsolutePath(); System.out.println(error); throw new Exception(error); } Properties prop = new Properties(); try (FileInputStream inStream = new FileInputStream(confFile)) { prop.load(inStream); } for (Entry<Object, Object> keyValue : prop.entrySet()) { this.configs.put((String)keyValue.getKey(), (String)keyValue.getValue()); } } return result; }</code><technical_language>(Not a Java developer ;)) !confFile.isFile() a check (since exists canRead return true for a readable directory)</technical_language>

Target:
private boolean parseKeywords(String[] args, int i) throws Exception { boolean result = false; if (checkPair(args, NEW_SESSION, i)) { result = true; } else if (checkPair(args, SESSION, i)) { result = true; } else if (checkPair(args, DIR, i)) { Constant.setZapHome(keywords.get(DIR)); result = true; } else if (checkPair(args, INSTALL_DIR, i)) { Constant.setZapInstall(keywords.get(INSTALL_DIR)); result = true; } else if (checkPair(args, HOST, i)) { this.host = keywords.get(HOST); result = true; } else if (checkPair(args, PORT, i)) { this.port = Integer.parseInt(keywords.get(PORT)); result = true; } else if (checkPair(args, CONFIG, i)) { String pair = keywords.get(CONFIG); if (pair != null && pair.indexOf("=") > 0) { int eqIndex = pair.indexOf("="); this.configs.put(pair.substring(0, eqIndex), pair.substring(eqIndex + 1)); result = true; } } else if (checkPair(args, CONFIG_FILE, i)) { String conf = keywords.get(CONFIG_FILE); File confFile = new File(conf); if (! confFile.isFile()) { String error = "No such file: " + confFile.getAbsolutePath(); System.out.println(error); throw new Exception(error); } else if (! confFile.canRead()) { String error = "File not readable: " + confFile.getAbsolutePath(); System.out.println(error); throw new Exception(error); } Properties prop = new Properties(); try (FileInputStream inStream = new FileInputStream(confFile)) { prop.load(inStream); } for (Entry<Object, Object> keyValue : prop.entrySet()) { this.configs.put((String)keyValue.getKey(), (String)keyValue.getValue()); } } return result; }