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 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
`protected Log` `logger`

### Constructor Summary

Constructors
Constructor and Description
`AbstractFileNameVersionStrategy()`

### Method Summary

All Methods Instance Methods Concrete Methods
`String` `addVersion(String requestPath, String version)` Add a version to the given request path.
`String` `extractVersion(String requestPath)` Extract the resource version from the request path.
`String` `removeVersion(String requestPath, 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`

### Methods inherited from interface org.springframework.web.reactive.resource.VersionStrategy

`getResourceVersion`

### Field Detail

#### logger

    protected final Log logger

### Constructor Detail

#### AbstractFileNameVersionStrategy

    public AbstractFileNameVersionStrategy()

### Method Detail

#### extractVersion

    public String extractVersion(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

#### removeVersion

    public String removeVersion(String requestPath,
                                String version)

Description copied from interface: `VersionStrategy`
Remove the version from the request path. It is assumed that the given version was extracted via `VersionStrategy.extractVersion(String)`.

Specified by:
  `removeVersion` in interface `VersionStrategy`
Parameters:
  `requestPath` - the request path of the resource being resolved
  `version` - the version obtained from `VersionStrategy.extractVersion(String)`
Returns:
  the request path with the version removed

#### addVersion

    public String addVersion(String requestPath,
                             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