private function composeFileName($name)
    {
        if (is_null($name)) {
            return $name;
        }

        $ext = $this->determineExtension();
        $withExtension = $this->createName($name, $ext);

        list($found, $fileName) = $this->searchFor($name, $withExtension);

        return $found ? $fileName : $name;
    }