class ExistingFileValidator implements ConstraintValidator<ExistingFile, File> {

    @Override
    public boolean isValid(File value, ConstraintValidatorContext context) {
        if (value != null) {
            return value.exists();
        }
        return true;
    }

}