Here you can find the source of applyCacheKeysToResourceUrls(Document document, long pluginModifiedTimestamp, Locale locale)
public static void applyCacheKeysToResourceUrls(Document document, long pluginModifiedTimestamp, Locale locale)
//package com.java2s; //License from project: Open Source License import org.jsoup.nodes.Document; import org.jsoup.nodes.Element; import org.jsoup.select.Elements; import java.util.Locale; public class Main { public static void applyCacheKeysToResourceUrls(Document document, long pluginModifiedTimestamp, Locale locale) {//from www .ja va 2 s .c o m String cacheKey = getCacheKeyPathSegments(pluginModifiedTimestamp, locale); Elements injectedScripts = document.select("script[data-spark-injected]"); for (Element script : injectedScripts) { script.attr("src", cacheKey + "/" + script.attr("src")); } Elements injectedStyles = document.select("link[data-spark-injected]"); for (Element style : injectedStyles) { style.attr("href", cacheKey + "/" + style.attr("href")); } } private static String getCacheKeyPathSegments(long pluginModifiedTimestamp, Locale locale) { return "_/" + pluginModifiedTimestamp + "/" + locale.toString(); } }