Added _getFile and _isSingleFileMatchingRegex

@keertip 

Also fixed a dormant error in _getFolder and made it shorter.