+ downloadCache = new Cache(dir, hoursChanging, hoursStable);
+ cache = downloadCache;
+ }
+
+ /**
+ * Create a new {@link DataLoader} object without disk cache (will keep a
+ * memory cache for manual cache operations).
+ *
+ * @param UA
+ * the User-Agent to use to download the resources
+ */
+ public DataLoader(String UA) {
+ downloader = new Downloader(UA);
+ downloadCache = null;
+ cache = new CacheMemory();
+ }
+
+ /**
+ * The traces handler for this {@link Cache}.
+ *
+ * @param tracer
+ * the new traces handler
+ */
+ public void setTraceHandler(TraceHandler tracer) {
+ downloader.setTraceHandler(tracer);
+ cache.setTraceHandler(tracer);
+ if (downloadCache != null) {
+ downloadCache.setTraceHandler(tracer);
+ }
+