/** * @return a new instance of a validator checking for an input string representing an existing file of the given type. Blank string are invalid. * @param type * type of the file represented by the input string * @see Validators#validEmpty(Validator) */ public static Validator<String> existingFileType(FileType type) { return new FileTypeValidator(type, true); }
/** * @return a new instance of a validator checking for an input string representing a file of the given type. Blank string are invalid. * @param type * type of the file represented by the input string * @param mustExist * if true the validator enforces an existing file * @see Validators#validEmpty(Validator) */ public static Validator<String> fileType(FileType type, boolean mustExist) { return new FileTypeValidator(type, mustExist); }