@Override public String call() throws Exception { return calculateMd5(htmlLibrary, htmlLibraryManager.isMinifyEnabled()); } });
public void handleEvent(Event event) { try { boolean minified = htmlLibraryManager.isMinifyEnabled(); String path = (String) event.getProperty(SlingConstants.PROPERTY_PATH); log.info("Client Library at {} invalidated. Sending reload.", path); ClientLibrary library = htmlLibraryManager.getLibraries().get(path); if (library != null) { for (LibraryType type : library.getTypes()) { String includePath = library.getIncludePath(type, minified); server.triggerReload(includePath); } } } catch (JSONException e) { log.info("Unable to send reload", e); } }
public void handleEvent(Event event) { try { boolean minified = htmlLibraryManager.isMinifyEnabled(); String path = (String) event.getProperty(SlingConstants.PROPERTY_PATH); log.info("Client Library at {} invalidated. Sending reload.", path); ClientLibrary library = htmlLibraryManager.getLibraries().get(path); if (library != null) { for (LibraryType type : library.getTypes()) { String includePath = library.getIncludePath(type, minified); server.triggerReload(includePath); } } } catch (JSONException e) { log.info("Unable to send reload", e); } }
md5FromCache = calculateMd5(uriInfo.htmlLibrary, htmlLibraryManager.isMinifyEnabled());
@Override protected void doGet(@Nonnull SlingHttpServletRequest request, @Nonnull SlingHttpServletResponse response) throws ServletException, IOException { ResourceResolver resourceResolver = request.getResourceResolver(); response.setContentType("application/json"); JsonWriter writer = new JsonWriter(response.getWriter()); writer.beginObject(); writer.name("js"); writer.beginArray(); if (!excludeAll) { Collection<ClientLibrary> libraries = htmlLibraryManager.getLibraries(categories, LibraryType.JS, true, true); for (ClientLibrary library : libraries) { writer.value(resourceResolver.map(request, library.getIncludePath(LibraryType.JS, htmlLibraryManager.isMinifyEnabled()))); } } writer.endArray(); writer.name("css"); writer.beginArray(); if (!excludeAll) { Collection<ClientLibrary> libraries = htmlLibraryManager.getLibraries(categories, LibraryType.CSS, true, true); for (ClientLibrary library : libraries) { writer.value(resourceResolver.map(request, library.getIncludePath(LibraryType.CSS, htmlLibraryManager.isMinifyEnabled()))); } } writer.endArray(); writer.endObject(); }