public final class LicenseKey extends Object
Modifier and Type | Method and Description |
---|---|
static LicenseInfo |
getLoadedLicenseInfo(String productName)
Gets info about loaded license for provided product name, trying to update the license.
|
static LicenseInfo |
getLoadedLicenseInfo(String productName, boolean checkingForUpdates)
Gets info about loaded license for provided product name.
|
static List<LicenseInfo> |
getLoadedLicensesInfo()
Gets info about loaded licenses.
|
static void |
loadLicenseFile(File licenseFile)
Loads a license file or array of licenses from a File .
|
static void |
loadLicenseFile(InputStream licenseIs)
Loads a license file or array of licenses using an InputStream .
|
static void |
unloadLicenseForProduct(String productName)
Unloads license for specific product.
|
static void |
unloadLicenses()
Unload all licenses for all products.
|
public static void unloadLicenses()
public static void unloadLicenseForProduct(String productName)
productName
- the name of the product for which license will be unloaded
public static void loadLicenseFile(File licenseFile) throws LicenseKeyException
File
. It is expected that file contains license as json object or json array of such licenses. The certificate is read from the jar.
Note that method does not perform any additional checks and does not consider license files loading as a transaction. If any error occurs, on loading array of licenses method execution will be stopped but already loaded licenses will not be unloaded.
licenseFile
- the file to load license
LicenseKeyException
- thrown if there's a problem with the license file
public static void loadLicenseFile(InputStream licenseIs) throws LicenseKeyException
InputStream
. It is expected that input stream contains license as json object or json array of such licenses. The certificate is read from the jar.
Note that method does not perform any additional checks and does not consider license files loading as a transaction. If any error occurs, on loading array of licenses method execution will be stopped but already loaded licenses will not be unloaded.
licenseIs
- the input stream for load license
LicenseKeyException
- thrown if there's a problem with the license file
public static List<LicenseInfo> getLoadedLicensesInfo()
public static LicenseInfo getLoadedLicenseInfo(String productName, boolean checkingForUpdates)
productName
- the product name
checkingForUpdates
- flag that specifies if updates need to be checked
null
if there is no license
public static LicenseInfo getLoadedLicenseInfo(String productName)
productName
- the product name
null
if there is no license
Copyright © 2023. All rights reserved.