Package com.atlassian.confluence.plugin
Class ConfluencePluginUtils
java.lang.Object
com.atlassian.confluence.plugin.ConfluencePluginUtils
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic File
createDirectoryIfDoesntExist
(File directory) Create a directory if there is no directory, otherwise do nothing.static File
getPluginsBaseDirectory
(String homeLocation) static <T> T
instantiatePluginModule
(com.atlassian.plugin.Plugin plugin, Class<T> cls) Instantiates a plugin module.
-
Field Details
-
PLUGIN_DESCRIPTOR_FILENAME
- See Also:
-
PARENT_DIRECTORY_PROPERTY_KEY
Setting this system property will place all the plugin system's directories in a particular parent directory in confluence-home. This is used by the continuous deployment system (internal to Atlassian) to ensure that bringing up a new Confluence instance does not conflict with the plugin working directories of the previous instance. It is not meant for use in general production.- See Also:
-
-
Constructor Details
-
ConfluencePluginUtils
public ConfluencePluginUtils()
-
-
Method Details
-
instantiatePluginModule
Instantiates a plugin module. First tries to let the plugin autowire the class, ifContainerManagedPlugin
is implemented, otherwise falls back to creation and autowiring by the internal Spring container.- Parameters:
plugin
- The plugin that contains the modulecls
- The class to instantiate and autowire- Returns:
- The created and autowired object
-
getPluginsBaseDirectory
-
createDirectoryIfDoesntExist
Create a directory if there is no directory, otherwise do nothing. Consider usingcommons.io.FileUtils.forceMkdir()
instead as it has more explicit error handling.- Parameters:
directory
- the directory to create.- Returns:
- the file object that was passed in.
- Throws:
com.atlassian.core.exception.InfrastructureException
- if a directory could not be created at that location
-