Package net.i2p.addressbook
Class SubscriptionList
- java.lang.Object
-
- net.i2p.addressbook.SubscriptionList
-
- All Implemented Interfaces:
Iterable<AddressBook>
class SubscriptionList extends Object implements Iterable<AddressBook>
A list of Subscriptions loaded from a file.- Author:
- Ragnarok
-
-
Constructor Summary
Constructors Constructor 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.SubscriptionList(String hoststxt)
Testing only.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
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 fetchdefaultSubs
- default subscription fileproxyHost
- proxy hostnameproxyPort
- 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 interfaceIterable<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.
-
-