package com.temporaryteam.noticeditor.io.importers;

import com.temporaryteam.noticeditor.io.IOUtil;
import java.net.URL;
import org.jsoup.safety.Whitelist;

/**
 * Load page from Internet, insert scripts, styles, images directly to html.
 *
 * @author Naik
 */
public class WebImporter extends HtmlImporter {
	
	@Override
	protected String cleanHtml(String url, Whitelist whitelist) throws Exception {
		String html = IOUtil.stringFromStream(new URL(url).openStream());
		return super.cleanHtml(html, whitelist);
	}
}

@@ -115,16 +115,64 @@
 et.URL;%0A
+import java.util.HashMap;%0Aimport java.util.Map;%0A
 import o
@@ -198,16 +198,16 @@
 telist;%0A
-
 %0A/**%0A * 
@@ -353,16 +353,78 @@
 ter %7B%0A%09%0A
+%09private final Map%3CString, String%3E cache = new HashMap%3C%3E();%0A%09%0A
 %09@Overri
@@ -515,16 +515,94 @@
 %09String 
+html;%0A%09%09if (cache.containsKey(url)) %7B%0A%09%09%09html = cache.get(url);%0A%09%09%7D else %7B%0A%09%09%09
 html = I
@@ -652,16 +652,45 @@
 eam());%0A
+%09%09%09cache.put(url, html);%0A%09%09%7D%0A
 %09%09return

Add cache to WebImporter