Enum Class TomcatVersion

java.lang.Object
java.lang.Enum<TomcatVersion>
io.github.rajendarreddyj.tomcat.config.TomcatVersion
All Implemented Interfaces:
Serializable, Comparable<TomcatVersion>, Constable

public enum TomcatVersion extends Enum<TomcatVersion>
Represents supported Tomcat versions with their download URLs and Java requirements.
Since:
1.0.0
Author:
rajendarreddyj
  • Enum Constant Details

    • TOMCAT_10_1

      public static final TomcatVersion TOMCAT_10_1
      Tomcat 10.1.x - Jakarta EE 10, requires Java 11+.
    • TOMCAT_11

      public static final TomcatVersion TOMCAT_11
      Tomcat 11.x - Jakarta EE 11, requires Java 17+.
  • Method Details

    • values

      public static TomcatVersion[] 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

      public static TomcatVersion valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • getMajorMinor

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

      public String getDownloadUrl(String fullVersion)
      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

      public String getArchiveDownloadUrl(String fullVersion)
      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

      public String getChecksumUrl(String fullVersion)
      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

      public String getArchiveChecksumUrl(String fullVersion)
      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

      public static TomcatVersion fromVersionString(String version)
      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