public function getTemporaryFile($directory = null)
    {
        if ($directory === null) {
            $directory = $this->getTemporaryDirectory();
        }

        $name = str_replace('.', '', uniqid('buffer', true));
        $path = $directory.'/'.$name;

        touch($path);

        return $path;
    }