private function locate($file)
    {
        if (isset($file[0]) && '@' === $file[0]) {
            if (false !== strpos($file, '..')) {
                throw new \RuntimeException(sprintf('File name "%s" contains invalid characters (..).', $file));
            }

            $bundleName = substr($file, 1);
            $path       = '';
            if (false !== strpos($bundleName, '/')) {
                list($bundleName, $path) = explode('/', $bundleName, 2);
            }

            $bundle = $this->kernel->getBundle($bundleName);
            $file   = $bundle->getPath() . '/' . $path;
        }

        return $file;
    }