Interface HashedFilesRegistry


public interface HashedFilesRegistry
Author:
Iván Zaera Avellón
  • Method Details

    • forEachHashedFileURI

      void forEachHashedFileURI(BiConsumer<String,String> biConsumer)
      Iterates registered hashed file URIs passing the unhashed and hashed file URI as arguments to the consumer in each iteration. The URIs are absolute to DXP server, i.e., they contain a prefix when DXP is not running in the application server's root context but not the proxy path even if it is configured.
    • forEachServletContextHash

      void forEachServletContextHash(BiConsumer<String,String> biConsumer)
      Iterates registered servlet contexts passing the servlet context name (eg: "frontend-js-web") and the associated hash to the consumer in each iteration.
    • getCachingStrategy

      CachingStrategy getCachingStrategy(jakarta.servlet.http.HttpServletRequest httpServletRequest)
    • getHashedFileURI

      String getHashedFileURI(String unhashedFileURI)
      Get the URI of the hashed file associated to an unhashed file URI. The URI is absolute to DXP server, i.e., it must contain a prefix when DXP is not running in the application server's root context but must not contain the proxy path if it is configured.
      Returns:
      a valid URI or null if hashed file does not exist
    • getResource

      URL getResource(String fileURI)
      Get the URL of the file associated to a given file URI. The URI is absolute to DXP server, i.e., it must contain a prefix when DXP is not running in the application server's root context but must not contain the proxy path if it is configured.
      Parameters:
      fileURI - a URI like '/o/frontend-js-web/__liferay__/index.js' or '/o/frontend-js-web/__liferay__/index.(zXjA8D).js'
      Returns:
      a valid URL or null if the file does not exist
    • getServletContextHash

      String getServletContextHash(String servletContextName)
      Get the hash of hashes of all hashed files associated to a servlet context name (eg: "frontend-js-web").