Package ca.corbett.updates
Class UpdateSources.UpdateSource
java.lang.Object
ca.corbett.updates.UpdateSources.UpdateSource
- Enclosing class:
UpdateSources
Represents a single remote update source, for use with the UpdateConfiguration class.
There are two key pieces of information associated with a remote update source:
- name: Some human-readable name for this data source.
- baseUrl: The base url for this UpdateSource. All paths are relative to this url.
- versionManifest: The relative path to the VersionManifest json file.
- publicKey (optional): - the remote host can publish a public key to use for digital signature verification of downloaded extension jars. See SignatureUtil class for more details on signing and verifying files. This field is optional but highly recommended. Without it, jars will be downloaded and installed with no verification. This field represents the relative path to the public key.
This class has convenience methods that allow you to retrieve the versionManifest and the publicKey either as fully-qualified URLs (built using the value in baseUrl), or as relative paths (relative to the baseUrl).
- Since:
- swing-extras 2.5
- Author:
- scorbo2
-
Constructor Summary
ConstructorsConstructorDescriptionUpdateSource(String name, URL baseUrl, String versionManifest) Create a new UpdateSource with the given baseUrl, versionManifest and no public key.UpdateSource(String name, URL baseUrl, String versionManifest, String publicKey) Creates an UpdateSource with the specified baseUrl, versionManifest, and public key. -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic UpdateSources.UpdateSourceFactory method to generate an UpdateSource instance from the given json file, assuming that the file is readable and contains well-formed json.static UpdateSources.UpdateSourceFactory method to generate an UpdateSource instance from the given raw json string, assuming that the json is well-formed and parseable.getName()inthashCode()booleanbooleantoString()
-
Constructor Details
-
UpdateSource
Create a new UpdateSource with the given baseUrl, versionManifest and no public key. Without a public key, digital signature verification will not be possible for extension jars downloaded from this remote source. -
UpdateSource
Creates an UpdateSource with the specified baseUrl, versionManifest, and public key.
-
-
Method Details
-
fromJson
public static UpdateSources.UpdateSource fromJson(String json) throws com.google.gson.JsonParseException Factory method to generate an UpdateSource instance from the given raw json string, assuming that the json is well-formed and parseable.- Throws:
com.google.gson.JsonParseException
-
fromFile
public static UpdateSources.UpdateSource fromFile(File file) throws IOException, com.google.gson.JsonParseException Factory method to generate an UpdateSource instance from the given json file, assuming that the file is readable and contains well-formed json.- Throws:
IOExceptioncom.google.gson.JsonParseException
-
getName
-
getBaseUrl
-
isLocalSource
public boolean isLocalSource() -
getVersionManifestRelativePath
-
getVersionManifestUrl
-
hasPublicKey
public boolean hasPublicKey() -
getPublicKeyRelativePath
-
getPublicKeyUrl
-
equals
-
hashCode
public int hashCode() -
toString
-