Package com.atlassian.confluence.plugin
Class ConfluencePluginUtils
- java.lang.Object
-
- com.atlassian.confluence.plugin.ConfluencePluginUtils
-
public class ConfluencePluginUtils extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static String
PARENT_DIRECTORY_PROPERTY_KEY
Setting this system property will place all the plugin system's directories in a particular parent directory in confluence-home.static String
PLUGIN_DESCRIPTOR_FILENAME
-
Constructor Summary
Constructors Constructor Description ConfluencePluginUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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 Detail
-
PLUGIN_DESCRIPTOR_FILENAME
public static final String PLUGIN_DESCRIPTOR_FILENAME
- See Also:
- Constant Field Values
-
PARENT_DIRECTORY_PROPERTY_KEY
public static final String 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:
- Constant Field Values
-
-
Method Detail
-
instantiatePluginModule
public static <T> T instantiatePluginModule(com.atlassian.plugin.Plugin plugin, Class<T> cls)
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
-
createDirectoryIfDoesntExist
public static File createDirectoryIfDoesntExist(File directory)
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
-
-