Using Pentaho's Kettle tool, I have a transformation set up that starts with a Get File Names step to grab all XML files from a directory. The step is configured like this:
File/Directory: "c:\DataFolder"
Wildcard (RegExp): ".*xml"
This works great and gives me all the XML files in the folder "DataFolder".
However, if the DataFolder isn't present (because someone else deleted it), I get this error:
2012/11/30 12:15:27 - FileInputList - ERROR (version 4.3.0-stable, build 16786 from 2012-04-24 14.11.32 by buildguy) : org.apache.commons.vfs.FileNotFolderException: Could not list the contents of "file:///c:/DataFolder" because it is not a folder.
2012/11/30 12:15:27 - FileInputList - ERROR (version 4.3.0-stable, build 16786 from 2012-04-24 14.11.32 by buildguy) : at org.apache.commons.vfs.provider.AbstractFileObject.getChildren(Unknown Source)
2012/11/30 12:15:27 - FileInputList - ERROR (version 4.3.0-stable, build 16786 from 2012-04-24 14.11.32 by buildguy) : at org.pentaho.di.core.fileinput.FileInputList.createFileList(FileInputList.java:268)
2012/11/30 12:15:27 - FileInputList - ERROR (version 4.3.0-stable, build 16786 from 2012-04-24 14.11.32 by buildguy) : at org.pentaho.di.trans.steps.getfilenames.GetFileNamesMeta.getFileList(GetFileNamesMeta.java:690)
2012/11/30 12:15:27 - FileInputList - ERROR (version 4.3.0-stable, build 16786 from 2012-04-24 14.11.32 by buildguy) : at org.pentaho.di.trans.steps.getfilenames.GetFileNames.init(GetFileNames.java:336)
2012/11/30 12:15:27 - FileInputList - ERROR (version 4.3.0-stable, build 16786 from 2012-04-24 14.11.32 by buildguy) : at org.pentaho.di.trans.step.StepInitThread.run(StepInitThread.java:62)
2012/11/30 12:15:27 - FileInputList - ERROR (version 4.3.0-stable, build 16786 from 2012-04-24 14.11.32 by buildguy) : at java.lang.Thread.run(Unknown Source)
or in short: FileNotFolderException: Could not list the contents of "file:///c:/DataFolder" because it is not a folder.
If the folder doesn't exist, I want to simply stop the transformation and not proceed.
I've tried using the File Exists step combined with a Filter Rows step to provide a conditional, but no luck. The Hello World tutorial shows you how to check if a file exists, but not an entire folder.