Checks that a given path is valid. If it's not, raises NotFoundException

def _checkpath(self, path):
        """ Checks that a given path is valid. If it's not, raises NotFoundException """
        if path.startswith("/") or ".." in path or path.strip() != path:
            raise NotFoundException()