public function createFile($path, $data = null)
    {
        if ($this->hasNodeAt($path)) {
            throw new \RuntimeException(sprintf('%s already exists', $path));
        }

        $parent =  $this->directoryAt(dirname($path));

        $parent->addFile($newFile = $this->factory()->getFile(basename($path)));

        $newFile->setData($data);

        return $newFile;

    }