use of com.xrtb.db.DataBaseObject in project XRTB by benmfaul.
the class Configuration method readBlackListIntoCache.
/**
* Reads the blacklist into cache2k when aerospike is not being used.
*
* @param fname
* String. The name of the blacklist.
* @throws Exception
* on file I/O or cache2k errors.
*/
private static void readBlackListIntoCache(String fname) throws Exception {
String content = new String(Files.readAllBytes(Paths.get(fname)), StandardCharsets.UTF_8);
System.out.println(content);
List<String> list = DbTools.mapper.readValue(content, List.class);
DataBaseObject shared = DataBaseObject.getInstance();
shared.addToBlackList(list);
}
Aggregations