Class JarManifestChecker

java.lang.Object
com.vaadin.flow.server.scanner.JarManifestChecker

public class JarManifestChecker extends Object
Utility class for checking if JAR files contain the Vaadin package version manifest attribute.

This is used by the annotation scanner to determine which JARs should be scanned for Vaadin annotations. Only JARs with the Vaadin-Package-Version manifest attribute are considered Vaadin add-ons.

Results are cached to avoid repeated JAR reads for performance.

Since:
25.0
  • Field Details

    • VAADIN_PACKAGE_VERSION

      public static final String VAADIN_PACKAGE_VERSION
      The manifest attribute name that identifies a Vaadin add-on package.
      See Also:
  • Method Details

    • hasVaadinManifest

      public static boolean hasVaadinManifest(File jarFile)
      Checks if a JAR file has the Vaadin-Package-Version manifest attribute.

      Results are cached to avoid repeated JAR reads. The cache uses the File object as the key, so if the same file is checked multiple times, the manifest is only read once.

      Parameters:
      jarFile - the JAR file to check, not null
      Returns:
      true if the JAR has a manifest with the Vaadin-Package-Version attribute, false otherwise
    • clearCache

      public static void clearCache()
      Clears the manifest cache. This is mainly useful for testing purposes.
    • getCacheSize

      public static int getCacheSize()
      Returns the current size of the manifest cache. This is mainly useful for testing and monitoring purposes.
      Returns:
      the number of cached manifest check results