Interface RetrieverStorage


  • public interface RetrieverStorage
    Storage interface for the retriever module, allows the client of the RetrieverService to store downloaded resources in any suitable way.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String maybeDownloadResource​(java.lang.String elementName, java.lang.String attributeName, java.lang.String resourceUri, org.xml.sax.Attributes attributes)
      Download the resource if the storage wants to do that, and if downloaded return the URI of the downloaded resource.
      void storeContent​(java.lang.String content)
      Store the content that was retrieved and processed
    • Method Detail

      • storeContent

        void storeContent​(java.lang.String content)
                   throws java.io.IOException,
                          RepositoryException
        Store the content that was retrieved and processed
        Throws:
        java.io.IOException
        RepositoryException
      • maybeDownloadResource

        java.lang.String maybeDownloadResource​(java.lang.String elementName,
                                               java.lang.String attributeName,
                                               java.lang.String resourceUri,
                                               org.xml.sax.Attributes attributes)
                                        throws java.io.IOException,
                                               RepositoryException
        Download the resource if the storage wants to do that, and if downloaded return the URI of the downloaded resource. The idea in not downloading all resources is that large images, for example, might be better left as absolute URIs in the content when sending large quantities of mail, to keep the mailing bandwidth low.
        Parameters:
        elementName - the html element that contains the URI
        attributeName - the html attribute that contains the URI
        resourceUri - the attribute value (absolute URL)
        attributes - the rest of the element's attributes
        Throws:
        java.io.IOException
        RepositoryException