Updated BaseFileHelper filterPath to improve performance

Edits to the ```filterPath``` call - so that unnecessary code is not executed (unless required). For example calls to ```is_dir``` or ```strlen``` is only needed if the ```only``` or ```except``` is passed.