|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.addressbook.AddressBook
public class AddressBook
An address book for storing human readable names mapped to base64 i2p destinations. AddressBooks can be created from local and remote files, merged together, and written out to local files.
Field Summary | |
---|---|
(package private) static long |
MAX_SUB_SIZE
|
Constructor Summary | |
---|---|
AddressBook(java.io.File file)
Construct an AddressBook from the contents of the file at file. |
|
AddressBook(java.util.Map addresses)
Construct an AddressBook from the contents of the Map addresses. |
|
AddressBook(Subscription subscription,
java.lang.String proxyHost,
int proxyPort)
Construct an AddressBook from the Subscription subscription. |
Method Summary | |
---|---|
java.util.Map |
getAddresses()
Return a Map containing the addresses in the AddressBook. |
java.lang.String |
getLocation()
Return the location of the file this AddressBook was constructed from. |
void |
merge(AddressBook other,
boolean overwrite,
Log log)
Merge this AddressBook with AddressBook other, writing messages about new addresses or conflicts to log. |
java.lang.String |
toString()
Return a string representation of the contents of the AddressBook. |
void |
write()
Write this AddressBook out to the file it was read from. |
void |
write(java.io.File file)
Write the contents of this AddressBook out to the File file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
static final long MAX_SUB_SIZE
Constructor Detail |
---|
public AddressBook(java.util.Map addresses)
addresses
- A Map containing human readable addresses as keys, mapped to
base64 i2p destinations.public AddressBook(Subscription subscription, java.lang.String proxyHost, int proxyPort)
subscription
- A Subscription instance pointing at a remote address book.proxyHost
- hostname of proxyproxyPort
- port number of proxypublic AddressBook(java.io.File file)
file
- A File pointing at a file with lines in the format
"key=value", where key is a human readable name, and value is
a base64 i2p destination.Method Detail |
---|
public java.util.Map getAddresses()
public java.lang.String getLocation()
public java.lang.String toString()
toString
in class java.lang.Object
public void merge(AddressBook other, boolean overwrite, Log log)
other
- An AddressBook to merge with.overwrite
- True to overwritelog
- The log to write messages about new addresses or conflicts to.public void write(java.io.File file)
file
- The file to write the contents of this AddressBook too.public void write()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |