public FileBasedIPList reload() { return new FileBasedIPList(fileName); }
public CombinedIPList(String fixedBlackListFile, String variableBlackListFile, long cacheExpiryInSeconds) { IPList fixedNetworkList = new FileBasedIPList(fixedBlackListFile); if (variableBlackListFile != null) { IPList variableNetworkList = new CacheableIPList( new FileBasedIPList(variableBlackListFile), cacheExpiryInSeconds); networkLists = new IPList[]{fixedNetworkList, variableNetworkList}; } else { networkLists = new IPList[]{fixedNetworkList}; } }
public CombinedIPWhiteList(String fixedWhiteListFile, String variableWhiteListFile, long cacheExpiryInSeconds) { IPList fixedNetworkList = new FileBasedIPList(fixedWhiteListFile); if (variableWhiteListFile != null){ IPList variableNetworkList = new CacheableIPList( new FileBasedIPList(variableWhiteListFile),cacheExpiryInSeconds); networkLists = new IPList[] {fixedNetworkList, variableNetworkList}; } else { networkLists = new IPList[] {fixedNetworkList}; } } @Override
public FileBasedIPList reload() { return new FileBasedIPList(fileName); }
public FileBasedIPList reload() { return new FileBasedIPList(fileName); }
public FileBasedIPList reload() { return new FileBasedIPList(fileName); }
public FileBasedIPList reload() { return new FileBasedIPList(fileName); }
public CombinedIPWhiteList(String fixedWhiteListFile, String variableWhiteListFile, long cacheExpiryInSeconds) { IPList fixedNetworkList = new FileBasedIPList(fixedWhiteListFile); if (variableWhiteListFile != null){ IPList variableNetworkList = new CacheableIPList( new FileBasedIPList(variableWhiteListFile),cacheExpiryInSeconds); networkLists = new IPList[] {fixedNetworkList, variableNetworkList}; } else { networkLists = new IPList[] {fixedNetworkList}; } } @Override
public CombinedIPWhiteList(String fixedWhiteListFile, String variableWhiteListFile, long cacheExpiryInSeconds) { IPList fixedNetworkList = new FileBasedIPList(fixedWhiteListFile); if (variableWhiteListFile != null){ IPList variableNetworkList = new CacheableIPList( new FileBasedIPList(variableWhiteListFile),cacheExpiryInSeconds); networkLists = new IPList[] {fixedNetworkList, variableNetworkList}; } else { networkLists = new IPList[] {fixedNetworkList}; } } @Override
public CombinedIPWhiteList(String fixedWhiteListFile, String variableWhiteListFile, long cacheExpiryInSeconds) { IPList fixedNetworkList = new FileBasedIPList(fixedWhiteListFile); if (variableWhiteListFile != null){ IPList variableNetworkList = new CacheableIPList( new FileBasedIPList(variableWhiteListFile),cacheExpiryInSeconds); networkLists = new IPList[] {fixedNetworkList, variableNetworkList}; } else { networkLists = new IPList[] {fixedNetworkList}; } } @Override
public CombinedIPWhiteList(String fixedWhiteListFile, String variableWhiteListFile, long cacheExpiryInSeconds) { IPList fixedNetworkList = new FileBasedIPList(fixedWhiteListFile); if (variableWhiteListFile != null){ IPList variableNetworkList = new CacheableIPList( new FileBasedIPList(variableWhiteListFile),cacheExpiryInSeconds); networkLists = new IPList[] {fixedNetworkList, variableNetworkList}; } else { networkLists = new IPList[] {fixedNetworkList}; } } @Override
/** * Do not specify the file * test for inclusion * should be true as if the feature is turned off */ public void testFileNotSpecified() { IPList ipl = new FileBasedIPList(null); assertFalse("110.113.221.222 is in the list", ipl.isIn("110.113.221.222")); }
/** * Specify a non existent file * test for inclusion * should be true as if the feature is turned off */ public void testFileMissing() { IPList ipl = new FileBasedIPList("missingips.txt"); assertFalse("110.113.221.222 is in the list", ipl.isIn("110.113.221.222")); }
/** * Specify a non existent file * test for inclusion * should be true as if the feature is turned off */ public void testFileMissing() { IPList ipl = new FileBasedIPList("missingips.txt"); assertFalse("110.113.221.222 is in the list", ipl.isIn("110.113.221.222")); }
/** * Do not specify the file * test for inclusion * should be true as if the feature is turned off */ public void testFileNotSpecified() { IPList ipl = new FileBasedIPList(null); assertFalse("110.113.221.222 is in the list", ipl.isIn("110.113.221.222")); }
/** * Specify an existing file, but ips in wrong format * test for inclusion * should be true as if the feature is turned off */ public void testForBadFIle() throws IOException { String[] ips = { "10.221.102/23"}; createFileWithEntries ("ips.txt", ips); try { new FileBasedIPList("ips.txt"); fail(); } catch (Exception e) { //expects Exception } }
/** * Specify an existing file, but empty * test for inclusion * should be true as if the feature is turned off */ public void testWithEmptyList() throws IOException { String[] ips = {}; createFileWithEntries ("ips.txt", ips); IPList ipl = new FileBasedIPList("ips.txt"); assertFalse("110.113.221.222 is in the list", ipl.isIn("110.113.221.222")); }
/** * Specify an existing file, but empty * test for inclusion * should be true as if the feature is turned off */ public void testWithEmptyList() throws IOException { String[] ips = {}; createFileWithEntries ("ips.txt", ips); IPList ipl = new FileBasedIPList("ips.txt"); assertFalse("110.113.221.222 is in the list", ipl.isIn("110.113.221.222")); }
/** * Add a bunch of IPS to the file * Check for inclusion * Check for exclusion */ @Test public void testNullIP() throws IOException { String[] ips = {"10.119.103.112", "10.221.102.0/23"}; createFileWithEntries ("ips.txt", ips); IPList ipList = new FileBasedIPList("ips.txt"); assertFalse ("Null Ip is in the list", ipList.isIn(null)); }
/** * Add a bunch of IPS to the file * Check for inclusion * Check for exclusion */ @Test public void testNullIP() throws IOException { String[] ips = {"10.119.103.112", "10.221.102.0/23"}; createFileWithEntries ("ips.txt", ips); IPList ipList = new FileBasedIPList("ips.txt"); assertFalse ("Null Ip is in the list", ipList.isIn(null)); }