Top Description Methods
org.springframework.web.servlet.resource

public Interface VersionPathStrategy

Known Direct Subinterfaces
org.springframework.web.servlet.resource.VersionStrategy
Known Direct Implementers
org.springframework.web.servlet.resource.AbstractVersionStrategy.PrefixVersionPathStrategy, org.springframework.web.servlet.resource.AbstractVersionStrategy.FileNameVersionPathStrategy
Imports
org.springframework.lang.Nullable

A strategy for extracting and embedding a resource version in its URL path.
Authors
Brian Clozel, Rossen Stoyanchev
Since
4.1

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the requestPath updated with a version string
addVersion
(String
the requestPath
requestPath
,
String
the version
version
)

Add a version to the given request path.

public String

Returns:

the version string or null if none was found
extractVersion
(String
the request path to check
requestPath
)

Extract the resource version from the request path.

public String

Returns:

the request path with the version removed
removeVersion
(String
the request path of the resource being resolved
requestPath
,
String
the version obtained from extractVersion(String)
version
)

Remove the version from the request path.

Method Detail

addVersionback to summary
public String addVersion(String requestPath, String version)

Add a version to the given request path.

Parameters
requestPath:String

the requestPath

version:String

the version

Returns:String

the requestPath updated with a version string

extractVersionback to summary
public String extractVersion(String requestPath)

Extract the resource version from the request path.

Parameters
requestPath:String

the request path to check

Returns:String

the version string or null if none was found

Annotations
@Nullable
removeVersionback to summary
public 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:String

the request path of the resource being resolved

version:String

the version obtained from extractVersion(String)

Returns:String

the request path with the version removed