org.jwall.rbl.data
Class RblFile

java.lang.Object
  extended by org.jwall.rbl.data.RblFile
All Implemented Interfaces:
RBList

public class RblFile
extends Object
implements RBList

This class implements a hash-based RBL.

Author:
Christian Bockermann <chris@jwall.org>

Constructor Summary
RblFile(File file)
           
 
Method Summary
 void add(RBListEntry entry)
          This method adds the given entry to the list.
 boolean contains(String name)
          Checks whether the given key (e.g.
 RBListEntry lookup(String name)
          Returns the entry for the given name.
protected  void readDatabase(File file)
          This method parses the given file and reads all entries found within.
 boolean remove(String name)
           
 List<RBListEntry> search(String query)
           
 void store()
           
 void store(OutputStream o)
          Writes this RBL to the given output stream (CSV format).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RblFile

public RblFile(File file)
        throws IOException
Parameters:
file -
Throws:
IOException
Method Detail

readDatabase

protected void readDatabase(File file)
                     throws IOException
This method parses the given file and reads all entries found within. The file is expected to be in CSV format

Parameters:
file -
Throws:
IOException

store

public void store(OutputStream o)
           throws IOException
Writes this RBL to the given output stream (CSV format).

Parameters:
o -
Throws:
IOException

add

public void add(RBListEntry entry)
Description copied from interface: RBList
This method adds the given entry to the list. Queries for this element should immediately become effective.

Specified by:
add in interface RBList
See Also:
RBList.add(org.jwall.rbl.data.RBListEntry)

contains

public boolean contains(String name)
Description copied from interface: RBList
Checks whether the given key (e.g. IP address, hostname) is contained in this block list.

Specified by:
contains in interface RBList
Returns:
See Also:
RBList.contains(java.lang.String)

lookup

public RBListEntry lookup(String name)
Description copied from interface: RBList
Returns the entry for the given name.

Specified by:
lookup in interface RBList
Returns:
See Also:
RBList.lookup(java.lang.String)

remove

public boolean remove(String name)
Specified by:
remove in interface RBList

search

public List<RBListEntry> search(String query)
Specified by:
search in interface RBList

store

public void store()
Specified by:
store in interface RBList


Copyright © 2014. All Rights Reserved.