Class SubscriptionList

    • Constructor Detail

      • SubscriptionList

        public SubscriptionList​(File locationsFile,
                                File etagsFile,
                                File lastModifiedFile,
                                File lastFetchedFile,
                                long delay,
                                List<String> defaultSubs,
                                String proxyHost,
                                int proxyPort)
        Construct a SubscriptionList using the urls from locationsFile and, if available, the etags and last-modified headers loaded from etagsFile and lastModifiedFile.
        Parameters:
        locationsFile - A file containing one url on each line.
        etagsFile - A file containg the etag headers used for conditional GET. The file is in the format "url=etag".
        lastModifiedFile - A file containg the last-modified headers used for conditional GET. The file is in the format "url=leastmodified".
        delay - the minimum delay since last fetched for the iterator to actually fetch
        defaultSubs - default subscription file
        proxyHost - proxy hostname
        proxyPort - proxy port number
      • SubscriptionList

        public SubscriptionList​(String hoststxt)
        Testing only.
        Parameters:
        hoststxt - path to a local file used as the test 'subscription' input
        Since:
        0.9.26
    • Method Detail

      • iterator

        public SubscriptionIterator iterator()
        Return an iterator over the AddressBooks represented by the Subscriptions in this SubscriptionList.
        Specified by:
        iterator in interface Iterable<AddressBook>
        Returns:
        A SubscriptionIterator.
      • write

        public void write()
        Write the etag and last-modified headers, and the last-fetched time, for each Subscription to files. BUG - If the subscription URL is a cgi containing an '=' the files won't be read back correctly; the '=' should be escaped.