When directories are assumed, parse the given string as a directory.  Added option to specify file types