private function file_or_dir($path, $is_file) {
        assert(is_bool($is_file));
        $obj = $this->get($path);
        if ($obj !== null && $is_file === $obj->isFile()) {
            return $obj;
        }
        return null;
    }