Class VersionManifest
Example manifest
{
"manifestGenerated": "2025-10-16T00:53:33.946196621Z",
"applicationName": "ExampleApplication",
"applicationVersions": [
{
"version": "1.0",
"extensions": [
{
"name": "MyFirstExtension",
"versions": [
{
"extInfo:" { ... },
"downloadPath": "MyFirstExtension-1.0.0.jar",
"signaturePath": "MyFirstExtension-1.0.0.sig",
"screenshots": [
"MyFirstExtension-1.0.0_screenshot1.jpg"
]
},
{
"extInfo:" { ... },
"downloadPath": "MyFirstExtension-1.0.1.jar",
"signaturePath": "MyFirstExtension-1.0.1.sig",
"screenshots": [
"MyFirstExtension-1.0.1_screenshot1.jpg",
"MyFirstExtension-1.0.1_screenshot2.png"
]
}
]
}
]
}
]
}
The above example shows a simple application VersionManifest with a single application version, which has a single extension called MyFirstExtension. This extension has two versions available, 1.0.0 and 1.0.1 - both of these versions have been digitally signed (we can tell this because they both provide a signaturePath to be used for verification of the jar).
Notice that all paths in the version manifest are relative! But relative to what? A VersionManifest can only properly be interpreted through an UpdateSource, which contains a baseUrl - all paths are relative to this baseUrl. The reason for this is that one application may have many UpdateSources, but we don't want to have to generate a VersionManifest for each one, when the contents would be identical except for file locations. So, we generate the VersionManifest just once, and an application can understand it in conjunction with the baseUrl from any corresponding UpdateSource.
How do I set all this up? - There's a helper application called ExtPackager that can walk you through the process of setting up your UpdateSources json and your VersionManifest, and can also help you with things like digitally signing your extension jars, providing screenshots for each version, and uploading to your web host via FTP. You don't have to write this json by hand!
- Since:
- swing-extras 2.5
- Author:
- scorbo2
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents a single version of the application in question, along with all of its compatible extensions.static classRepresents a single extension for the application in question, along with all of the versions of this extension.static classRepresents a single version of a single extension. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidbooleanThis is a bit wonky, but because ExtensionVersion does not know about the Extension that contains it, I have to have this lookup function to find the Extension for a given ExtensionVersion.Returns the ApplicationVersion with the highest version number.static VersionManifeststatic VersionManifestReturns a list of all ApplicationVersions for this Application.getApplicationVersionsForMajorVersion(int majorVersion) Returns a list of all ApplicationVersions for the given major version number of this Application.getHighestExtensionVersionsForMajorAppVersion(int majorAppVersion) Returns a sorted list of the highest-version ExtensionVersion for each Extension that is available for the specified major version of this Application.getHighestVersionForExtension(String extensionName) Returns the highest ExtensionVersion for the given extension name, across all application versions.getHighestVersionForExtensionInMajorAppVersion(String extensionName, int majorAppVersion) Returns the highest ExtensionVersion for the given extension name, across all application versions that match the given major version number.Get the manifestGenerated timestamp in some local time zone, for example: ZoneId.of("America/Edmonton").Returns a list of all unique extension names across all application versions for this Application.getUniqueExtensionNamesForMajorVersion(int majorVersion) Returns a list of all unique extension names for the given major version number of this Application.inthashCode()voidvoidTemp code?voidsetApplicationName(String applicationName) voidsetManifestGenerated(String timestampString) voidsetManifestGenerated(Instant instant)
-
Constructor Details
-
VersionManifest
public VersionManifest()
-
-
Method Details
-
fromFile
public static VersionManifest fromFile(File sourceFile) throws IOException, com.google.gson.JsonSyntaxException - Throws:
IOExceptioncom.google.gson.JsonSyntaxException
-
fromJson
- Throws:
com.google.gson.JsonSyntaxException
-
save
Temp code? Authoring should move to ext-packager repo- Throws:
IOException
-
getManifestGenerated
-
setManifestGenerated
-
setManifestGenerated
-
getManifestGeneratedAsLocalTime
Get the manifestGenerated timestamp in some local time zone, for example: ZoneId.of("America/Edmonton"). -
getApplicationName
-
setApplicationName
-
getApplicationVersions
Returns a list of all ApplicationVersions for this Application. -
getApplicationVersionsForMajorVersion
public List<VersionManifest.ApplicationVersion> getApplicationVersionsForMajorVersion(int majorVersion) Returns a list of all ApplicationVersions for the given major version number of this Application. -
getUniqueExtensionNames
Returns a list of all unique extension names across all application versions for this Application. -
getUniqueExtensionNamesForMajorVersion
Returns a list of all unique extension names for the given major version number of this Application. -
getHighestVersionForExtension
public Optional<VersionManifest.ExtensionVersion> getHighestVersionForExtension(String extensionName) Returns the highest ExtensionVersion for the given extension name, across all application versions. -
getHighestVersionForExtensionInMajorAppVersion
public Optional<VersionManifest.ExtensionVersion> getHighestVersionForExtensionInMajorAppVersion(String extensionName, int majorAppVersion) Returns the highest ExtensionVersion for the given extension name, across all application versions that match the given major version number. -
getHighestExtensionVersionsForMajorAppVersion
public List<VersionManifest.ExtensionVersion> getHighestExtensionVersionsForMajorAppVersion(int majorAppVersion) Returns a sorted list of the highest-version ExtensionVersion for each Extension that is available for the specified major version of this Application. The list is sorted by extension name. -
findExtensionForExtensionVersion
public Optional<VersionManifest.Extension> findExtensionForExtensionVersion(VersionManifest.ExtensionVersion extVersion) This is a bit wonky, but because ExtensionVersion does not know about the Extension that contains it, I have to have this lookup function to find the Extension for a given ExtensionVersion. -
addApplicationVersion
-
removeApplicationVersion
-
clearApplicationVersions
public void clearApplicationVersions() -
equals
-
hashCode
public int hashCode() -
findLatestApplicationVersion
Returns the ApplicationVersion with the highest version number. Will return null if there are no ApplicationVersions here.
-