Class PluginDirectoryService
- java.lang.Object
-
- ch.sahits.game.openpatrician.plugin.installer.PluginDirectoryService
-
@Service public class PluginDirectoryService extends java.lang.Object
Service to handle plugin directory related service functionality.- Author:
- Andi Hotz, (c) Sahits GmbH, 2018 Created on Apr 15, 2018
-
-
Field Summary
Fields Modifier and Type Field Description private LocalStorage
localStorage
-
Constructor Summary
Constructors Constructor Description PluginDirectoryService(LocalStorage localStorage)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
createPluginDir()
Ensure that the plugin directory exists.private EPluginType
getPluginType(java.lang.String tempDirPath)
void
installExtractedPlugin(java.lang.String tempPluginFolder)
Install the plugin that was extracted to thetempPluginFolder
into the appropriate plugin folder.void
updatePluginProperties(java.util.List<java.lang.String> basePackages)
Add or update the plugin properties base packages.
-
-
-
Field Detail
-
localStorage
private LocalStorage localStorage
-
-
Constructor Detail
-
PluginDirectoryService
public PluginDirectoryService(LocalStorage localStorage)
-
-
Method Detail
-
createPluginDir
public void createPluginDir()
Ensure that the plugin directory exists. If it is not yet created, do so.
-
installExtractedPlugin
public void installExtractedPlugin(java.lang.String tempPluginFolder) throws javax.xml.bind.JAXBException, java.io.IOException
Install the plugin that was extracted to thetempPluginFolder
into the appropriate plugin folder.- Parameters:
tempPluginFolder
- temp directory containing the extracted plugin- Throws:
javax.xml.bind.JAXBException
- failed to parse the plugin.xmljava.io.IOException
- failed to copy the plugin jar
-
updatePluginProperties
public void updatePluginProperties(java.util.List<java.lang.String> basePackages) throws java.io.IOException
Add or update the plugin properties base packages.- Parameters:
basePackages
- list of base packages that should be added.- Throws:
java.io.IOException
-
getPluginType
private EPluginType getPluginType(java.lang.String tempDirPath) throws javax.xml.bind.JAXBException
- Throws:
javax.xml.bind.JAXBException
-
-