protected function copyResultFile($handler, $file)
    {
        if (!is_file($file)) {
            throw new \OutOfBoundsException("Result file $file is not readable");
        }

        $extension = 'xml';
        if (preg_match('(\.([a-z]+)$)', $file, $match)) {
            $extension = $match[1];
        }

        copy($file, $this->targetDir . '/' . $handler . '.' . $extension);

        return "$handler.$extension";
    }