Interface VersionPathStrategy

All Known Subinterfaces:
VersionStrategy
All Known Implementing Classes:
AbstractVersionStrategy, AbstractVersionStrategy.FileNameVersionPathStrategy, AbstractVersionStrategy.PrefixVersionPathStrategy, ContentVersionStrategy, FixedVersionStrategy

public interface VersionPathStrategy
A strategy for extracting and embedding a resource version in its URL path.
Since:
4.1
Author:
Brian Clozel, Rossen Stoyanchev
  • Method Details

    • extractVersion

      @Nullable String extractVersion(String requestPath)
      Extract the resource version from the request path.
      Parameters:
      requestPath - the request path to check
      Returns:
      the version string or null if none was found
    • removeVersion

      String removeVersion(String requestPath, String version)
      Remove the version from the request path. It is assumed that the given version was extracted via extractVersion(String).
      Parameters:
      requestPath - the request path of the resource being resolved
      version - the version obtained from extractVersion(String)
      Returns:
      the request path with the version removed
    • addVersion

      String addVersion(String requestPath, String version)
      Add a version to the given request path.
      Parameters:
      requestPath - the requestPath
      version - the version
      Returns:
      the requestPath updated with a version string