/** * The <code>verifyFileExists()</code> method verifies that the specified file exists and is * readable. If the file does not exist, it will report an error to the user and return <code> * false</code>. * * @param file the name of the file * @return true if the file exists and is readable; false otherwise */ public static boolean verifyFileExists(String file) { File f = new File(file); if (!f.exists()) { userError("File not found", file); return false; } return true; }
/** * The method is called by an option implementation when there is a problem parsing the value for * an option supplied by the user on the command line. For example, if an integer is not in the * correct format, this method will be called, which will report an error. * * @param name the name of the option * @param type the value type * @param val the (invalid) value passed */ protected void parseError(String name, String type, String val) { Util.userError( "Option Error", "invalid value for " + type + " option " + StringUtil.quote(name) + " = " + StringUtil.quote(val)); }