public function move($fromPath, $toPath)
    {
        $fromNode = $this->nodeAt($fromPath);

        try {
            $nodeToOverride = $this->nodeAt($toPath);

            if (!is_a($nodeToOverride, get_class($fromNode))) {
                //nodes of a different type
                throw new \RuntimeException('Can\'t move.');
            }

            if ($nodeToOverride instanceof Directory) {
                if ($nodeToOverride->size()) {
                    //nodes of a different type
                    throw new \RuntimeException('Can\'t override non empty directory.');
                }
            }

            $this->remove($toPath, true);

        } catch (NotFoundException $e) {
            //nothing at destination, we're good
        }

        $toParent = $this->directoryAt(dirname($toPath));

        $fromNode->setBasename(basename($toPath));

        $toParent->addNode($fromNode);

        $this->remove($fromPath, true);

    }