Checks if the passed path is directory or not.