Enum Class TomcatVersion
- All Implemented Interfaces:
Serializable,Comparable<TomcatVersion>,Constable
Represents supported Tomcat versions with their download URLs and Java
requirements.
- Since:
- 1.0.0
- Author:
- rajendarreddyj
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionTomcat 10.1.x - Jakarta EE 10, requires Java 11+.Tomcat 11.x - Jakarta EE 11, requires Java 17+. -
Method Summary
Modifier and TypeMethodDescriptionstatic TomcatVersionfromVersionString(String version) Determines the TomcatVersion from a version string.getArchiveChecksumUrl(String fullVersion) Gets the archive checksum URL for a specific version.getArchiveDownloadUrl(String fullVersion) Gets the fallback (archive) download URL for a specific version.getChecksumUrl(String fullVersion) Gets the checksum URL for a specific version.getDownloadUrl(String fullVersion) Gets the primary download URL for a specific version.Gets the major.minor version string.intGets the minimum Java version required.voidValidates that the current Java runtime meets the minimum requirements.static TomcatVersionReturns the enum constant of this class with the specified name.static TomcatVersion[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
TOMCAT_10_1
Tomcat 10.1.x - Jakarta EE 10, requires Java 11+. -
TOMCAT_11
Tomcat 11.x - Jakarta EE 11, requires Java 17+.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getMajorMinor
Gets the major.minor version string.- Returns:
- the major.minor version (e.g., "10.1" or "11")
-
getMinimumJava
public int getMinimumJava()Gets the minimum Java version required.- Returns:
- the minimum Java version
-
getDownloadUrl
Gets the primary download URL for a specific version.- Parameters:
fullVersion- the full version string (e.g., "10.1.52")- Returns:
- the download URL
-
getArchiveDownloadUrl
Gets the fallback (archive) download URL for a specific version.- Parameters:
fullVersion- the full version string (e.g., "10.1.52")- Returns:
- the archive download URL
-
getChecksumUrl
Gets the checksum URL for a specific version.- Parameters:
fullVersion- the full version string (e.g., "10.1.52")- Returns:
- the SHA-512 checksum URL
-
getArchiveChecksumUrl
Gets the archive checksum URL for a specific version.- Parameters:
fullVersion- the full version string (e.g., "10.1.52")- Returns:
- the archive SHA-512 checksum URL
-
fromVersionString
Determines the TomcatVersion from a version string.- Parameters:
version- the version string (e.g., "10.1.52" or "11.0.2")- Returns:
- the corresponding TomcatVersion
- Throws:
IllegalArgumentException- if the version is not supported
-
validateJavaVersion
public void validateJavaVersion()Validates that the current Java runtime meets the minimum requirements.- Throws:
IllegalStateException- if Java version is insufficient
-