java.lang.Object
i2p.susi.dns.BaseBean
i2p.susi.dns.SubscriptionsBean

public class SubscriptionsBeanextends BaseBean
Bean for managing address book subscription sources and updates.
  • Field Details

    • fileName

      private String fileName
      The subscriptions file being edited.
    • content

      private String content
      Contents of that file.
    • SUBS_FILE

      private static final String SUBS_FILE
      Name of the subscriptions file.
      See Also:
    • DEFAULT_SUB

      private static final String DEFAULT_SUB
      The default subscriptions, the hosts.txt feeds. If you change these, change the addressbook daemon's defaults as well.
      See Also:
  • Constructor Details

    • SubscriptionsBean

      public SubscriptionsBean()
      No subscription file has been resolved yet; getFileName() and loadConfig() fill fileName and content in from disk on first use.
  • Method Details

    • getFileName

      public String getFileName()
      Get the subscriptions file path.
      Returns:
      the absolute path to the subscriptions file
    • subsFile

      private File subsFile()
      The subscriptions file.
      Returns:
      the subscriptions file under the addressbook directory
    • reloadSubs

      private void reloadSubs()
      Re-reads the subscriptions file.
    • locked_reloadSubs

      private void locked_reloadSubs()
      Reload subscriptions from file (synchronized wrapper).
    • save

      private void save()
      Save subscriptions to file.
    • locked_save

      private void locked_save()
      Save subscriptions to file (synchronized wrapper).
    • getMessages

      public String getMessages()
      Get status messages for the UI.
      Returns:
      HTML formatted status message
    • setContent

      public void setContent(String content)
      Set the subscriptions content.
      Parameters:
      content - the new subscriptions content
    • getContent

      public String getContent()
      Get the current subscriptions content.
      Returns:
      the subscriptions content, or default subscriptions if file doesn't exist