public function resourcesAction($filename, $base_dir = null)
    {
        if (null === $base_dir) {
            File::resolveFilepath($filename, null, array('include_path' => $this->application->getResourceDir()));
        } else {
            File::resolveFilepath($filename, null, array('base_dir' => $base_dir));
        }

        $this->application->info(sprintf('Handling resource URL `%s`.', $filename));

        if (false === file_exists($filename) || false === is_readable($filename)) {
            $request = $this->application->getRequest();

            throw new FrontControllerException(sprintf(
                'The file `%s` can not be found (referer: %s).',
                $request->getHost().'/'.$request->getPathInfo(),
                $request->server->get('HTTP_REFERER')
            ), FrontControllerException::NOT_FOUND);
        }

        return $this->createResourceResponse($filename);
    }