Package com.vaadin.flow.server.scanner
Class JarManifestChecker
java.lang.Object
com.vaadin.flow.server.scanner.JarManifestChecker
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe manifest attribute name that identifies a Vaadin add-on package. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidClears the manifest cache.static intReturns the current size of the manifest cache.static booleanhasVaadinManifest(File jarFile) Checks if a JAR file has the Vaadin-Package-Version manifest attribute.
-
Field Details
-
VAADIN_PACKAGE_VERSION
The manifest attribute name that identifies a Vaadin add-on package.- See Also:
-
-
Method Details
-
hasVaadinManifest
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:
trueif the JAR has a manifest with the Vaadin-Package-Version attribute,falseotherwise
-
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
-