Class FileExistsValidator
- java.lang.Object
-
- org.pentaho.di.job.entry.validator.AbstractFileValidator
-
- org.pentaho.di.job.entry.validator.FileExistsValidator
-
- All Implemented Interfaces:
JobEntryValidator
public class FileExistsValidator extends AbstractFileValidator
Fails if a field's value is a filename and the file does not exist.- Author:
- mlowery
-
-
Field Summary
Fields Modifier and Type Field Description static FileExistsValidatorINSTANCE-
Fields inherited from interface org.pentaho.di.job.entry.validator.JobEntryValidator
KEY_LEVEL_ON_FAIL
-
-
Constructor Summary
Constructors Constructor Description FileExistsValidator()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleangetFailIfDoesNotExist(org.pentaho.di.core.CheckResultSourceInterface source, String propertyName, List<org.pentaho.di.core.CheckResultInterface> remarks, ValidatorContext context)StringgetName()Returns the name of this validator, unique among all validators.static ValidatorContextputFailIfDoesNotExist(boolean failIfDoesNotExist)static voidputFailIfDoesNotExist(ValidatorContext context, boolean failIfDoesNotExist)booleanvalidate(org.pentaho.di.core.CheckResultSourceInterface source, String propertyName, List<org.pentaho.di.core.CheckResultInterface> remarks, ValidatorContext context)Using reflection, the validator fetches the field namedpropertyNamefrom the beansourceand runs the validation putting any messages intoremarks.-
Methods inherited from class org.pentaho.di.job.entry.validator.AbstractFileValidator
getVariableSpace, putVariableSpace, putVariableSpace
-
-
-
-
Field Detail
-
INSTANCE
public static final FileExistsValidator INSTANCE
-
-
Method Detail
-
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:JobEntryValidatorUsing reflection, the validator fetches the field namedpropertyNamefrom the beansourceand runs the validation putting any messages intoremarks. The return value istrueif 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
public String getName()
Description copied from interface:JobEntryValidatorReturns the name of this validator, unique among all validators.- Returns:
- name
-
putFailIfDoesNotExist
public static ValidatorContext putFailIfDoesNotExist(boolean failIfDoesNotExist)
-
getFailIfDoesNotExist
protected boolean getFailIfDoesNotExist(org.pentaho.di.core.CheckResultSourceInterface source, String propertyName, List<org.pentaho.di.core.CheckResultInterface> remarks, ValidatorContext context)
-
putFailIfDoesNotExist
public static void putFailIfDoesNotExist(ValidatorContext context, boolean failIfDoesNotExist)
-
-