Retrieve the content for the given document from the cache.

        :type doc_url: String or Document
        :param doc_url: the URL of the document, or a Document object

        :rtype: String
        :returns: the document data

        :raises: ValueError if the item is not in the cache

def get_document(self, doc_url):
        """ Retrieve the content for the given document from the cache.

        :type doc_url: String or Document
        :param doc_url: the URL of the document, or a Document object

        :rtype: String
        :returns: the document data

        :raises: ValueError if the item is not in the cache


        """
        c = self.conn.cursor()
        c.execute("SELECT * FROM documents WHERE url=?", (str(doc_url),))
        row = c.fetchone()
        c.close()
        if row is None:
            raise ValueError("Item not present in cache")
        file_path = row[1]
        try:
            with open(file_path, 'rb') as f:
                return f.read()
        except IOError as e:
            raise IOError("Error reading file " + file_path +
                          " to retrieve document " + doc_url +
                          ": " + e.message)