org.springframework.web.reactive.resource

Class AbstractPrefixVersionStrategy

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


    public abstract class AbstractPrefixVersionStrategy
    extends java.lang.Object
    implements VersionStrategy
    Abstract base class for VersionStrategy implementations that insert a prefix into the URL path, e.g. "version/static/myresource.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 path, 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

      • AbstractPrefixVersionStrategy

        protected AbstractPrefixVersionStrategy(java.lang.String version)
    • 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 path,
                                           java.lang.String version)
        Description copied from interface: VersionStrategy
        Add a version to the given request path.
        Specified by:
        addVersion in interface VersionStrategy
        Parameters:
        path - the requestPath
        version - the version
        Returns:
        the requestPath updated with a version string