public function attachmentUrlFilter($key, $filter = null)
    {
        if (empty($key))
        {
            return '';
        }

        try
        {
            $url = $this->attachmentHandler->getFileUrl($key);
        }
        catch (AttachmentException $e)
        {
            return '';
        }

        if (null === $filter)
        {
            return $url;
        }

        return $this->cacheManager->getBrowserPath($url, $filter);
    }