Class MultiReleaseUtil


  • public class MultiReleaseUtil
    extends java.lang.Object
    Utility class for working with multi-release JAR files.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  MultiReleaseUtil.MultiReleaseInfo
      Provides the return value for calls to MultiVersionUtil#parseVersion(String).
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static MultiReleaseUtil.MultiReleaseInfo parseVersion​(java.lang.String name)
      Parses a JAR entry name and, if it represents a multi-release JAR entry, returns the target Java version and the start point of the resource name in the JAR entry name.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • parseVersion

        public static MultiReleaseUtil.MultiReleaseInfo parseVersion​(java.lang.String name)
        Parses a JAR entry name and, if it represents a multi-release JAR entry, returns the target Java version and the start point of the resource name in the JAR entry name. Version numbers with leading zeros, signs or values less than 8 are ignored to match the JRE 21 onwards behaviour.
        Parameters:
        name - Name of the JAR entry
        Returns:
        The MultiVersionInfo for the entry if the entry represents a versioned entry, otherwise null