Updated BaseFileHelper filterPath to improve performance

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