java.lang.Object
net.i2p.i2ptunnel.BlacklistBean

public class BlacklistBeanextends Object
Simple blacklist checker for HTTP proxy. Loads blacklist from addressbook/blacklist.txt and checks if addresses are blacklisted. Standalone implementation to avoid susidns dependencies.
  • Field Details

    • _log

      private static final Log _log
      Logger for this class.
    • content

      private String content
      The blacklist text, one entry per line.
    • NEWLINE_SPLIT

      private static final Pattern NEWLINE_SPLIT
      Splits the blacklist text at line breaks.
  • Constructor Details

    • BlacklistBean

      public BlacklistBean()
      Creates an empty blacklist bean.
  • Method Details

    • blacklistFile

      private File blacklistFile()
      Get the blacklist file, searching common I2P directory locations.
      Returns:
      the blacklist File object
    • reloadBlacklist

      private void reloadBlacklist()
      Reload the blacklist content from file into memory.
    • isBlacklisted

      public boolean isBlacklisted(String address)
      Check if an address is blacklisted.
      Parameters:
      address - the I2P address to check, may be a hostname or base32/Base64 address
      Returns:
      true if the address is in the blacklist, false otherwise