java.lang.Object
net.i2p.i2ptunnel.access.FilterFactory
Factory for incoming connection filters. Only public class in this package.
Constructor Summary
ConstructorsMethod Summary
All MethodsModifier and TypeMethodDescriptionstatic StatefulConnectionFiltercreateFilter(I2PAppContext context, File definition) Creates an instance of IncomingConnectionFilter based on the definition contained in the given file.
Constructor Details
FilterFactory
public FilterFactory()Constructor. Filters are always built by the staticcreateFilter(I2PAppContext, File)from a definition file, so an instance carries no state.
Method Details
createFilter
public static StatefulConnectionFilter createFilter(I2PAppContext context, File definition) throws IOException, InvalidDefinitionException Creates an instance of IncomingConnectionFilter based on the definition contained in the given file.- Parameters:
context- the app context whose service references the created filter consultsdefinition- file containing the filter definition- Returns:
- the filter built from the parsed definition, ready to filter connections
- Throws:
IOException- if the definition file cannot be readInvalidDefinitionException- if the file does not parse as a filter definition