net.i2p.addressbook

## Class SubscriptionList

- java.lang.Object
- - net.i2p.addressbook.SubscriptionList

-      class SubscriptionList
      extends Object

  A list of Subscriptions loaded from a file.
  Author:
    Ragnarok

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `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.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `SubscriptionIterator` | `iterator()` Return an iterator over the AddressBooks represented by the Subscriptions in this SubscriptionList.
    `void` | `write()` Write the etag and last-modified headers, and the last-fetched time, for each Subscription to files.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 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

  - ### Method Detail

    - #### iterator

          public SubscriptionIterator iterator()

      Return an iterator over the AddressBooks represented by the Subscriptions in this SubscriptionList.
      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.