1 package org.kuali.common.util.validate; 2 3 import java.io.File; 4 5 import javax.validation.ConstraintValidatorContext; 6 7 public class FileExistsValidator extends AbstractExistsValidator<File> { 8 9 @Override 10 public void initialize(Exists constraintAnnotation) { 11 } 12 13 @Override 14 public boolean isValid(File file, ConstraintValidatorContext context) { 15 if (file == null) { 16 return true; 17 } else { 18 boolean valid = file.exists(); 19 doValidCheck(valid, file.getAbsolutePath(), context); 20 return valid; 21 } 22 } 23 24 }