org.pentaho.di.job.entry.validator
Class FileExistsValidator

java.lang.Object
  extended by org.pentaho.di.job.entry.validator.AbstractFileValidator
      extended by 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
static FileExistsValidator INSTANCE
           
 
Fields inherited from interface org.pentaho.di.job.entry.validator.JobEntryValidator
KEY_LEVEL_ON_FAIL
 
Constructor Summary
FileExistsValidator()
           
 
Method Summary
 String 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(CheckResultSourceInterface source, String propertyName, List<CheckResultInterface> remarks, ValidatorContext context)
          Using reflection, the validator fetches the field named propertyName from the bean source and runs the validation putting any messages into remarks.
 
Methods inherited from class org.pentaho.di.job.entry.validator.AbstractFileValidator
putVariableSpace, putVariableSpace
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final FileExistsValidator INSTANCE
Constructor Detail

FileExistsValidator

public FileExistsValidator()
Method Detail

validate

public boolean validate(CheckResultSourceInterface source,
                        String propertyName,
                        List<CheckResultInterface> remarks,
                        ValidatorContext context)
Description copied from interface: JobEntryValidator
Using reflection, the validator fetches the field named propertyName from the bean source and runs the validation putting any messages into remarks. The return value is true if the validation passes.

Parameters:
source - bean to validate
propertyName - property to validate
remarks - list to which to add messages
context - any other information needed to perform the validation
Returns:
validation result

getName

public String getName()
Description copied from interface: JobEntryValidator
Returns the name of this validator, unique among all validators.

Returns:
name

putFailIfDoesNotExist

public static ValidatorContext putFailIfDoesNotExist(boolean failIfDoesNotExist)

putFailIfDoesNotExist

public static void putFailIfDoesNotExist(ValidatorContext context,
                                         boolean failIfDoesNotExist)