private void index(HttpServletResponse rsp) throws Exception { Bundle b = context.getBundle(); URL url = cache.internalUrlOf(b, "osgi/enroute/web/index.html"); CacheFile c = cache.getFromBundle(b, url, "osgi/enroute/web/index.html"); if (c == null || c.is404 || c.isNotFound()) { url = cache.internalUrlOf(b, "osgi/enroute/web/local/index.html"); c = cache.getFromBundle(b, url, "osgi/enroute/web/local/index.html"); } String content = IO.collect(c.file); Map<String,String> map = new HashMap<>(); synchronized (index) { map.put("index", new JSONCodec().enc().put(index).indent(" ").toString()); } ReplacerAdapter ra = new ReplacerAdapter(map); content = ra.process(content); IO.store(content, rsp.getOutputStream()); }