Class BundleVersionInfo<T>
java.lang.Object
org.apache.sling.commons.osgi.bundleversion.BundleVersionInfo<T>
- All Implemented Interfaces:
Comparable<BundleVersionInfo<?>>
- Direct Known Subclasses:
BundleBundleVersionInfo
,FileBundleVersionInfo
public abstract class BundleVersionInfo<T>
extends Object
implements Comparable<BundleVersionInfo<?>>
Provides bundle version information, which can be
extracted from bundle files or Bundle objects.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Name of the BND attribute that provides the bundle's last modified timestampstatic final long
Value forgetBundleLastModified()
if corresponding header is not presentstatic final String
Marker used by Maven to identify snapshots -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(BundleVersionInfo<?> other) Compare based on bundle version info, and for snapshots based ongetBundleLastModified()
abstract long
Return the bundle last modification time, based on the BND_LAST_MODIFIED manifest header, if available.abstract String
abstract T
abstract org.osgi.framework.Version
abstract boolean
isBundle()
abstract boolean
-
Field Details
-
SNAPSHOT_MARKER
Marker used by Maven to identify snapshots- See Also:
-
BND_LAST_MODIFIED
Name of the BND attribute that provides the bundle's last modified timestamp- See Also:
-
BND_LAST_MODIFIED_MISSING
public static final long BND_LAST_MODIFIED_MISSINGValue forgetBundleLastModified()
if corresponding header is not present- See Also:
-
-
Constructor Details
-
BundleVersionInfo
public BundleVersionInfo()
-
-
Method Details
-
getSource
- Returns:
- Return the source of information: underlying File or Bundle
-
isBundle
public abstract boolean isBundle()- Returns:
- True if the provided data is a valid bundle
-
getBundleSymbolicName
- Returns:
- Return the bundle symbolic name, null if not available
-
getVersion
public abstract org.osgi.framework.Version getVersion()- Returns:
- Return the bundle version, null if not available
-
isSnapshot
public abstract boolean isSnapshot()- Returns:
- True if the bundle version indicates a snapshot
-
getBundleLastModified
public abstract long getBundleLastModified()Return the bundle last modification time, based on the BND_LAST_MODIFIED manifest header, if available. This is *not* the Bundle.getLastModified() value, which refers to actions in the OSGi framework.- Returns:
- BND_LAST_MODIFIED_MISSING if header not supplied
-
compareTo
Compare based on bundle version info, and for snapshots based ongetBundleLastModified()
- Specified by:
compareTo
in interfaceComparable<T>
-