Class ConfluencePluginUtils

  • public class ConfluencePluginUtils
    extends Object
    • Field Detail


        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
    • Constructor Detail

      • ConfluencePluginUtils

        public ConfluencePluginUtils()
    • 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, if ContainerManagedPlugin is implemented, otherwise falls back to creation and autowiring by the internal Spring container.
        plugin - The plugin that contains the module
        cls - The class to instantiate and autowire
        The created and autowired object
      • getPluginsBaseDirectory

        public static File getPluginsBaseDirectory​(String homeLocation)
      • createDirectoryIfDoesntExist

        public static File createDirectoryIfDoesntExist​(File directory)
        Create a directory if there is no directory, otherwise do nothing. Consider using instead as it has more explicit error handling.
        directory - the directory to create.
        the file object that was passed in.
        com.atlassian.core.exception.InfrastructureException - if a directory could not be created at that location