<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 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()