Class FileExistsValidator
java.lang.Object
org.pentaho.di.job.entry.validator.AbstractFileValidator
org.pentaho.di.job.entry.validator.FileExistsValidator
- All Implemented Interfaces:
JobEntryValidator
Fails if a field's value is a filename and the file does not exist.
- Author:
- mlowery
-
Field Summary
FieldsFields inherited from interface org.pentaho.di.job.entry.validator.JobEntryValidator
KEY_LEVEL_ON_FAIL
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
getFailIfDoesNotExist
(org.pentaho.di.core.CheckResultSourceInterface source, String propertyName, List<org.pentaho.di.core.CheckResultInterface> remarks, ValidatorContext context) getName()
Returns the name of this validator, unique among all validators.static ValidatorContext
putFailIfDoesNotExist
(boolean failIfDoesNotExist) static void
putFailIfDoesNotExist
(ValidatorContext context, boolean failIfDoesNotExist) boolean
validate
(org.pentaho.di.core.CheckResultSourceInterface source, String propertyName, List<org.pentaho.di.core.CheckResultInterface> remarks, ValidatorContext context) Using reflection, the validator fetches the field namedpropertyName
from the beansource
and runs the validation putting any messages intoremarks
.Methods inherited from class org.pentaho.di.job.entry.validator.AbstractFileValidator
getVariableSpace, putVariableSpace, putVariableSpace
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
FileExistsValidator
public FileExistsValidator()
-
-
Method Details
-
validate
public boolean validate(org.pentaho.di.core.CheckResultSourceInterface source, String propertyName, List<org.pentaho.di.core.CheckResultInterface> remarks, ValidatorContext context) Description copied from interface:JobEntryValidator
Using reflection, the validator fetches the field namedpropertyName
from the beansource
and runs the validation putting any messages intoremarks
. The return value istrue
if the validation passes.- Parameters:
source
- bean to validatepropertyName
- property to validateremarks
- list to which to add messagescontext
- any other information needed to perform the validation- Returns:
- validation result
-
getName
Description copied from interface:JobEntryValidator
Returns the name of this validator, unique among all validators.- Returns:
- name
-
putFailIfDoesNotExist
-
getFailIfDoesNotExist
protected boolean getFailIfDoesNotExist(org.pentaho.di.core.CheckResultSourceInterface source, String propertyName, List<org.pentaho.di.core.CheckResultInterface> remarks, ValidatorContext context) -
putFailIfDoesNotExist
-