public static void main(String[] args) { ConfigBean config = new ConfigBean(); CacheBean cacheB = new CacheBean(); String cacheDir = args[1]; String baseDir = args[2]; String urlFile = args[3]; boolean refetch = false; if (args.length == 5 && args[4].equalsIgnoreCase("refetch")) { refetch = true; logger.debug("Forcing refetch"); } else { logger.debug("Not forcing refetch"); } config.initialize(null, cacheDir, baseDir, urlFile, -1); cacheB.initialize(config.getCacheDir(), true); UrlsBean ub = new UrlsBean(); ub.initialize(config, cacheB); ub.startBGFetcher(refetch); }
/** Given a url, returns true iff the url was alreaady fetched and is in the cache. */ public boolean getUrlState(String url) { return cache.isInTextCache(url); }