public class BasicGadgetBlacklist extends Object implements GadgetBlacklist
GadgetBlacklist, reading blacklist data
from a text file.
A single URL on a line blacklists this exact URL (case-insensitively).
A regular expression prefixed by "REGEXP" and a space on a line blacklists
all URL's that (case-insensitively) match that pattern. The regular
expression syntax is PCRE-based (using java.util.regex, so there are a few
insignificant differences). Regular expressions should be used sparingly as
they influence performance of every single gadget being rendered.
Lines starting with a "#" are comments.
Example:
# Block the illegal bar.xml gadget
http://foo.com/bar.xml
# Block all gadgets from the baz.com domain (including subdomains)
REGEXP http://[^/]*baz.com/.*| Constructor and Description |
|---|
BasicGadgetBlacklist(File blacklistFile)
Constructs a new blacklist from the given file.
|
BasicGadgetBlacklist(String file) |
public BasicGadgetBlacklist(File blacklistFile) throws IOException
blacklistFile - file containing blacklist entriesIOException - if reading the file fails@Inject public BasicGadgetBlacklist(String file) throws IOException
IOExceptionpublic boolean isBlacklisted(Uri gadgetUri)
isBlacklisted in interface GadgetBlacklistgadgetUri was found in this blacklist, false
otherwise.Copyright © 2007-2012. All Rights Reserved.