net.i2p.router.peermanager
Class ProfilePersistenceHelper

java.lang.Object
  extended by net.i2p.router.peermanager.ProfilePersistenceHelper

 class ProfilePersistenceHelper
extends Object

Write profiles to disk at shutdown, read at startup. The files are gzip compressed, we previously stored them with a ".dat" extension instead of ".txt.gz", so it wasn't apparent. Now migrated to a ".txt.gz" extension.


Field Summary
static String DEFAULT_PEER_PROFILE_DIR
           
static String PROP_PEER_PROFILE_DIR
           
 
Constructor Summary
ProfilePersistenceHelper(RouterContext ctx)
           
 
Method Summary
 PeerProfile readProfile(File file)
           
 Set<PeerProfile> readProfiles()
           
 void setUs(Hash routerIdentHash)
           
 void writeProfile(PeerProfile profile)
          write out the data from the profile to the stream
 void writeProfile(PeerProfile profile, OutputStream out)
          write out the data from the profile to the stream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROP_PEER_PROFILE_DIR

public static final String PROP_PEER_PROFILE_DIR
See Also:
Constant Field Values

DEFAULT_PEER_PROFILE_DIR

public static final String DEFAULT_PEER_PROFILE_DIR
See Also:
Constant Field Values
Constructor Detail

ProfilePersistenceHelper

public ProfilePersistenceHelper(RouterContext ctx)
Method Detail

setUs

public void setUs(Hash routerIdentHash)

writeProfile

public void writeProfile(PeerProfile profile)
write out the data from the profile to the stream


writeProfile

public void writeProfile(PeerProfile profile,
                         OutputStream out)
                  throws IOException
write out the data from the profile to the stream

Throws:
IOException

readProfiles

public Set<PeerProfile> readProfiles()

readProfile

public PeerProfile readProfile(File file)