Class ConfluencePluginUtils

java.lang.Object
com.atlassian.confluence.plugin.ConfluencePluginUtils

public class ConfluencePluginUtils extends Object
  • Field Details

    • PLUGIN_DESCRIPTOR_FILENAME

      public static final String PLUGIN_DESCRIPTOR_FILENAME
      See Also:
    • 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:
  • Constructor Details

    • ConfluencePluginUtils

      public ConfluencePluginUtils()
  • Method Details

    • 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.
      Parameters:
      plugin - The plugin that contains the module
      cls - The class to instantiate and autowire
      Returns:
      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 commons.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