@Override public String call() throws Exception { return calculateMd5(htmlLibrary, htmlLibraryManager.isMinifyEnabled()); } });
UriInfo(String cleanedUri, String md5, LibraryType libraryType, HtmlLibrary htmlLibrary) { this.cleanedUri = cleanedUri; this.md5 = md5; this.htmlLibrary = htmlLibrary; if (libraryType != null && htmlLibrary != null) { cacheKey = htmlLibrary.getLibraryPath() + libraryType.extension; } else { cacheKey = null; } } }
DumplibsClientLibrary(ClientLibrary lib) { this.path = lib.getPath(); this.types = lib.getTypes(); this.categories = lib.getCategories(); this.channels = lib.getChannels(); }
public String toString() { return library.getPath() + "[cat:" + StringUtils.join(library.getCategories()) + ", embed:"+ isEmbed +", type: "+ library.getTypes() +"]"; } }
DumplibsHtmlLibrary (HtmlLibrary lib) { this.name = lib.getName(); this.type = lib.getType(); this.path = lib.getPath(); this.minifiedPath = lib.getPath(true); this.libraryPath = lib.getLibraryPath(); this.scripts = lib.getScripts(); }
private ClientLibrary getClientLibrary(String path) { if (clientLibrariesCache == null) { clientLibrariesCache = Collections.unmodifiableMap(htmlLibraryManager.getLibraries()); } return clientLibrariesCache.get(path); }
private boolean hasProxyClientLibrary(final LibraryType type, final String path) { ClientLibrary clientLibrary = getClientLibrary(path); return clientLibrary != null && clientLibrary.allowProxy() && clientLibrary.getTypes().contains(type); }
VersionedClientLibraryMd5CacheKey(HtmlLibrary htmlLibrary) { this.path = htmlLibrary.getLibraryPath(); this.type = htmlLibrary.getType(); }
private LibraryType getLibraryType(String typeString) { LibraryType type; try { return LibraryType.valueOf(typeString.toUpperCase()); } catch (Exception e) { return LibraryType.JS; } }
private HtmlLibrary getLibrary(LibraryType libraryType, String libraryPath, ResourceResolver resourceResolver) { String resolvedLibraryPath = resolvePathIfProxied(libraryType, libraryPath, resourceResolver); return resolvedLibraryPath == null ? null : htmlLibraryManager.getLibrary(libraryType, resolvedLibraryPath); }
@Override public String call() throws Exception { return DigestUtils.md5Hex(htmlLibrary.getInputStream()); } });
@Override public String toString() { return new StringBuilder(path).append('.').append(type.name().toLowerCase()).toString(); }
@Override public void writeJsInclude(final SlingHttpServletRequest request, final Design design, final PageRegion pageRegion, final Writer writer) throws IOException { htmlLibraryManager.writeJsInclude(request, writer, this.getJsLibraries(design, pageRegion)); }
@Override public void writeCssInclude(final SlingHttpServletRequest request, final Design design, final PageRegion pageRegion, final Writer writer) throws IOException { htmlLibraryManager.writeCssInclude(request, writer, this.getCssLibraries(design, pageRegion)); }
VersionedClientLibraryMd5CacheKey(HtmlLibrary htmlLibrary) { this.path = htmlLibrary.getLibraryPath(); this.type = htmlLibrary.getType(); }
public static boolean isDependencyLoop(ClientLibraryDependency parent, String path) { while (parent != null) { if (path.equals(parent.library.getPath())) { return true; } parent = parent.parent; } return false; }
@Nonnull private String calculateMd5(@Nonnull final HtmlLibrary htmlLibrary, boolean isMinified) throws IOException { // make sure that the minified version is being request in case minification is globally enabled // as this will reset the dirty flag on the clientlib try (InputStream input = htmlLibrary.getInputStream(isMinified)) { return DigestUtils.md5Hex(input); } }
@Override public void writeJsInclude(final SlingHttpServletRequest request, final Design design, final PageRegion pageRegion, final Writer writer) throws IOException { htmlLibraryManager.writeJsInclude(request, writer, this.getJsLibraries(design, pageRegion)); }
@Override public void writeCssInclude(final SlingHttpServletRequest request, final Design design, final PageRegion pageRegion, final Writer writer) throws IOException { htmlLibraryManager.writeCssInclude(request, writer, this.getCssLibraries(design, pageRegion)); }