determines if the string is a directory path