public class PluginDescriptor extends Object
T-Plan Robot Enterprise, (C) 2009-2022 T-Plan Limited. All rights reserved.
Constructor and Description |
---|
PluginDescriptor()
Constructor to create an empty descriptor.
|
Modifier and Type | Method and Description |
---|---|
void |
addArchitecture(String arch) |
void |
addFile(File file,
File homeDir) |
static PluginDescriptor |
fromFolder(File folder)
Create a new plugin descriptor from a folder with the plugin files.
|
static PluginDescriptor |
fromZIP(File zip,
boolean populateFiles)
Create a plugin descriptor from plugin files within a ZIP archive.
|
List<String> |
getArchitectures() |
String |
getDate()
Get the plugin release date.
|
Date |
getDateDate()
Get the plugin release date as the
Date instance. |
Map<String,String> |
getDependencies() |
String |
getDescription()
Get the plugin description for the current locale or the English one if
the it is not available in the current current language.
|
String |
getDescription(String language)
Get description for the specified language.
|
Map<String,String> |
getDescriptions()
Get the map of localized plugin descriptions.
|
Map<String,String> |
getFiles() |
String |
getGroup() |
String |
getHelpLink() |
String |
getMainPath() |
String |
getMessageAfterInstall() |
String |
getMessageAfterInstall(String language)
Get message to be displayed after the installation for the specified
language.
|
String |
getMessageBeforeDelete() |
String |
getMessageBeforeDelete(String language) |
String |
getMessageBeforeInstall() |
String |
getMessageBeforeInstall(String language)
Get message to be displayed before the installation for the specified
language.
|
String |
getMessageBeforeUpdate() |
String |
getMessageBeforeUpdate(String language)
Get message to be displayed before the plugin update for the specified
language.
|
Map<String,String> |
getMessagesAfterInstall() |
Map<String,String> |
getMessagesBeforeDelete() |
Map<String,String> |
getMessagesBeforeInstall() |
Map<String,String> |
getMessagesBeforeUpdate() |
String |
getMinimumRobotVersion() |
String |
getName()
Get the plugin name for the current locale or the English one if the it
is not available in the current current language.
|
String |
getName(String language)
Get the plugin display name for the specified language.
|
Map<String,String> |
getNames()
Get the map of localized plugin names.
|
String |
getStartupRunnable() |
String |
getSupportContact()
Get the vendor's support contact.
|
String |
getTestClasses() |
String |
getUniqueId()
Get the plugin unique ID.
|
String |
getVendorHomePage() |
String |
getVendorName() |
String |
getVersion()
Get the plugin version.
|
boolean |
isCanDelete() |
boolean |
isCanUpdate() |
boolean |
isInstalledAsLegacyJAR(List<File> outFiles) |
boolean |
isLinux() |
boolean |
isMac() |
boolean |
isMacApp() |
boolean |
isRestartRequired() |
boolean |
isSupported(StringBuilder msg) |
boolean |
isWinApp() |
boolean |
isWindows() |
void |
remove(List<String> errors)
Uninstall (remove) the plugin.
|
void |
setArchitectures(List<String> architectures) |
void |
setCanDelete(boolean canDelete) |
void |
setCanUpdate(boolean canUpdate) |
void |
setDate(Date date) |
void |
setDate(String date)
Set the plugin release date.
|
void |
setDependencies(Map<String,String> dependencies) |
void |
setDescription(String description) |
void |
setDescription(String language,
String description) |
void |
setDescriptions(Map<String,String> descriptions) |
void |
setFiles(Map<String,String> files) |
void |
setGroup(String group) |
void |
setHelpLink(String helpLink) |
void |
setLinux(boolean linux) |
void |
setMac(boolean mac) |
void |
setMacApp(boolean macApp) |
void |
setMainPath(String mainPath) |
void |
setMessageAfterInstall(String msg) |
void |
setMessageAfterInstall(String language,
String msg) |
void |
setMessageBeforeDelete(String msg) |
void |
setMessageBeforeDelete(String language,
String msg) |
void |
setMessageBeforeInstall(String msg) |
void |
setMessageBeforeInstall(String language,
String msg) |
void |
setMessageBeforeUpdate(String msg) |
void |
setMessageBeforeUpdate(String language,
String msg) |
void |
setMessagesAfterInstall(Map<String,String> messages)
Set the map of messages to be displayed after the installation.
|
void |
setMessagesBeforeDelete(Map<String,String> messages)
Set the map of messages to be displayed before plugin removal.
|
void |
setMessagesBeforeInstall(Map<String,String> messages)
Set the map of messages to be displayed prior to installation.
|
void |
setMessagesBeforeUpdate(Map<String,String> messages)
Set the map of messages to be displayed before the plugin update.
|
void |
setMinimumRobotVersion(String minimumRobotVersion) |
void |
setName(String name) |
void |
setName(String language,
String name) |
void |
setNames(Map<String,String> descriptions) |
void |
setRestartRequired(boolean restartRequired) |
void |
setStartupRunnable(String startupRunnable) |
void |
setSupportContact(String supportContact)
Set the vendor's support contact.
|
void |
setTestClasses(String testClassses) |
void |
setUniqueId(String uniqueId)
Set the plugin unique ID.
|
void |
setVendorHomePage(String vendorHomePage) |
void |
setVendorName(String vendorName) |
void |
setVersion(String version)
Set the plugin version.
|
void |
setWinApp(boolean winApp) |
void |
setWindows(boolean windows) |
String |
toString()
Convert this instance to JSON.
|
void |
toZIP(File zip)
Write this descriptor into the argument plugin ZIP archive.
|
public PluginDescriptor()
public static PluginDescriptor fromFolder(File folder) throws IOException
folder
- a plugin folder.IOException
- on an I/O error.public static PluginDescriptor fromZIP(File zip, boolean populateFiles) throws IOException
zip
- a ZIP archive with plugin files.populateFiles
- true to create the "files" summary of files or false
to skip.IOException
- on an I/O error.public String toString()
public void toZIP(File zip) throws IOException
zip
- a plugin ZIP.IOException
- on an I/O error.public String getUniqueId()
public void setUniqueId(String uniqueId)
uniqueId
- a unique ID for the plugin.public String getVersion()
public void setVersion(String version)
version
- the version.public String getName()
public Map<String,String> getNames()
public String getName(String language)
language
- a 2-char ISO-639-1 language code.public Map<String,String> getDescriptions()
public String getDescription()
public String getDescription(String language)
language
- a 2-char ISO-639-1 language code.public void setDescriptions(Map<String,String> descriptions)
descriptions
- the descriptions to setpublic void setDescription(String description)
public void setNames(Map<String,String> descriptions)
descriptions
- the descriptions to setpublic void setName(String name)
public String getVendorName()
public void setVendorName(String vendorName)
vendorName
- the vendorName to setpublic String getVendorHomePage()
public void setVendorHomePage(String vendorHomePage)
vendorHomePage
- the vendorHomePage to setpublic String getMinimumRobotVersion()
public void setMinimumRobotVersion(String minimumRobotVersion)
minimumRobotVersion
- the minimumRobotVersion to setpublic Map<String,String> getMessagesBeforeInstall()
public String getMessageBeforeInstall(String language)
language
- a 2-char ISO-639-1 language code.public void setMessagesBeforeInstall(Map<String,String> messages)
messages
- map of messages where the key is a 2-char ISO-639-1
language code and the value is the message.public void setMessageBeforeInstall(String msg)
public String getMessageBeforeInstall()
public String getMessageAfterInstall()
public Map<String,String> getMessagesAfterInstall()
public String getMessageAfterInstall(String language)
language
- a 2-char ISO-639-1 language code.public void setMessagesAfterInstall(Map<String,String> messages)
messages
- map of messages where the key is a 2-char ISO-639-1
language code and the value is the message.public void setMessageAfterInstall(String msg)
public Map<String,String> getMessagesBeforeUpdate()
public String getMessageBeforeUpdate(String language)
language
- a 2-char ISO-639-1 language code.public void setMessagesBeforeUpdate(Map<String,String> messages)
messages
- map of messages where the key is a 2-char ISO-639-1
language code and the value is the message.public void setMessageBeforeUpdate(String msg)
public String getMessageBeforeUpdate()
public String getMessageBeforeDelete(String language)
language
- a 2-char ISO-639-1 language code.public void setMessagesBeforeDelete(Map<String,String> messages)
messages
- map of messages where the key is a 2-char ISO-639-1
language code and the value is the message.public void setMessageBeforeDelete(String msg)
public String getMessageBeforeDelete()
public String getSupportContact()
public void setSupportContact(String supportContact)
supportContact
- the support contact to set.public String getDate()
public void setDate(String date)
date
- the release date to set.public Date getDateDate() throws ParseException
Date
instance.ParseException
- if the internal string representation of the date
cannot be parsed.public void setDate(Date date)
date
- the date to setpublic boolean isRestartRequired()
public void setRestartRequired(boolean restartRequired)
restartRequired
- the restartRequired to setpublic void setDependencies(Map<String,String> dependencies)
dependencies
- the dependencies to setpublic boolean isWindows()
public void setWindows(boolean windows)
windows
- the windows to setpublic boolean isMac()
public void setMac(boolean mac)
mac
- the mac to setpublic boolean isLinux()
public void setLinux(boolean linux)
linux
- the linux to setpublic void setArchitectures(List<String> architectures)
architectures
- the architectures to setpublic void addArchitecture(String arch)
public void addFile(File file, File homeDir) throws IOException
IOException
public String getMainPath()
public void setMainPath(String mainPath)
mainPath
- the mainPath to setpublic String getStartupRunnable()
public void setStartupRunnable(String startupRunnable)
startupRunnable
- the startupRunnable to setpublic String getGroup()
public void setGroup(String group)
group
- the group to setpublic void remove(List<String> errors)
errors
- optional list for errors.public boolean isCanUpdate()
public void setCanUpdate(boolean canUpdate)
canUpdate
- the canUpdate to setpublic boolean isCanDelete()
public void setCanDelete(boolean canDelete)
canDelete
- the canDelete to setpublic String getTestClasses()
public void setTestClasses(String testClassses)
testClassses
- the testClasses to setpublic String getHelpLink()
public void setHelpLink(String helpLink)
helpLink
- the helpLink to setpublic boolean isSupported(StringBuilder msg)
public boolean isWinApp()
public void setWinApp(boolean winApp)
winApp
- the winApp to setpublic boolean isMacApp()
public void setMacApp(boolean macApp)
macApp
- the macApp to set