MCPcopy Create free account
hub / github.com/cloudfoundry/java-buildpack / DetermineTomcatVersion

Function DetermineTomcatVersion

src/java/containers/tomcat.go:477–481  ·  view source on GitHub ↗

based on the JBP_CONFIG_TOMCAT field from manifest. It looks for a tomcat block with a version of the form " .+" (e.g. "9.+", "10.+", "10.1.+"). Returns the pattern with "+" replaced by "*" (e.g. "9.*", "10.*", "10.1.*") so libbuildpack can resolve it. Masterminds/semver treats x, X, and * as

(version string)

Source from the content-addressed store, hash-verified

475// Returns the pattern with "+" replaced by "*" (e.g. "9.*", "10.*", "10.1.*") so libbuildpack can resolve it.
476// Masterminds/semver treats x, X, and * as equivalent wildcards.
477func DetermineTomcatVersion(version string) string {
478 // Replace "+" with "*" so libbuildpack's FindMatchingVersion can resolve it.
479 // e.g. "9.+" -> "9.*", "10.+" -> "10.*", "10.1.+" -> "10.1.*"
480 return strings.ReplaceAll(version, "+", "*")
481}
482
483// isAccessLoggingEnabled checks if access logging is enabled in configuration
484// Returns: "true" or "false" as a string (for use in JAVA_OPTS)

Callers 2

tomcat_test.goFile · 0.92
SupplyMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected