org.springframework.web.reactive.resource

Class AbstractFileNameVersionStrategy

  • java.lang.Object
    • org.springframework.web.reactive.resource.AbstractFileNameVersionStrategy
  • All Implemented Interfaces:
    VersionStrategy
    Direct Known Subclasses:
    ContentVersionStrategy


    public abstract class AbstractFileNameVersionStrategy
    extends java.lang.Object
    implements VersionStrategy
    Abstract base class for filename suffix based VersionStrategy implementations, e.g. "static/myresource-version.js"
    Since:
    5.0
    Author:
    Rossen Stoyanchev, Brian Clozel
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      protected Log logger 
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.lang.String addVersion(java.lang.String requestPath, java.lang.String version)
      Add a version to the given request path.
      java.lang.String extractVersion(java.lang.String requestPath)
      Extract the resource version from the request path.
      java.lang.String removeVersion(java.lang.String requestPath, java.lang.String version)
      Remove the version from the request path.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • logger

        protected final Log logger
    • Constructor Detail

      • AbstractFileNameVersionStrategy

        public AbstractFileNameVersionStrategy()
    • Method Detail

      • extractVersion

        public java.lang.String extractVersion(java.lang.String requestPath)
        Description copied from interface: VersionStrategy
        Extract the resource version from the request path.
        Specified by:
        extractVersion in interface VersionStrategy
        Parameters:
        requestPath - the request path to check
        Returns:
        the version string or null if none was found
      • addVersion

        public java.lang.String addVersion(java.lang.String requestPath,
                                           java.lang.String version)
        Description copied from interface: VersionStrategy
        Add a version to the given request path.
        Specified by:
        addVersion in interface VersionStrategy
        Parameters:
        requestPath - the requestPath
        version - the version
        Returns:
        the requestPath updated with a version string