com.atlassian.confluence.plugin
Class ConfluencePluginUtils

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

public class ConfluencePluginUtils
extends java.lang.Object


Field Summary
static java.lang.String CONFLUENCE_APPLICATION_KEY
          Deprecated. since 3.4
static java.util.Set<java.lang.String> CONFLUENCE_APPLICATION_KEYS
          Deprecated. since 3.4
static java.lang.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 java.lang.String PLUGIN_DESCRIPTOR_FILENAME
           
 
Constructor Summary
ConfluencePluginUtils()
           
 
Method Summary
static java.io.File createDirectoryIfDoesntExist(java.io.File directory)
          Create a directory if there is no directory, otherwise do nothing.
static java.io.File createDirectoryIfDoesntExist(java.lang.String directoryLocation)
          Deprecated. since 4.0. Use createDirectoryIfDoesntExist(java.io.File), or better still use commons.io.FileUtils.forceMkdir() directly.
static java.io.File getBundledPluginDirectory(BootstrapManager bootstrapManager)
          Deprecated. since 3.4, use com.atlassian.confluence.plugin.PluginDirectoryProvider#getBundledPluginDirectory If running before bootstrap use getBundledPluginDirectory(HomeLocator homeLocator), the homeLocator returns the correct confluence home even if bootstrap hasn't been initialised.
static java.io.File getBundledPluginDirectory(com.atlassian.config.HomeLocator homeLocator)
          Deprecated. since 3.4, use com.atlassian.confluence.plugin.PluginDirectoryProvider#getBundledPluginDirectory Finds the bundled plugins directory in the confluence home. If it doesn't exist the directory is created.
static java.io.File getPluginDirectory(BootstrapManager bootstrapManager)
          Deprecated. since 3.4, use com.atlassian.confluence.plugin.PluginDirectoryProvider#getPluginDirectory
static java.io.File getPluginsBaseDirectory(java.lang.String homeLocation)
           
static java.io.File getPluginsPersistentCacheDirectory(BootstrapManager bootstrapManager)
          Deprecated. since 3.4, use com.atlassian.confluence.plugin.PluginDirectoryProvider#getPluginsPersistentCacheDirectory If running before bootstrap use getBundledPluginDirectory(HomeLocator homeLocator), the homeLocator returns the correct confluence home even if bootstrap hasn't been initialised.
static java.io.File getPluginsPersistentCacheDirectory(com.atlassian.config.HomeLocator homeLocator)
          Deprecated. since 3.4, use com.atlassian.confluence.plugin.PluginDirectoryProvider#getPluginsPersistentCacheDirectory Finds the plugins persistent cache directory in the confluence home. If it doesn't exist the directory is created.
static java.io.File getPluginTempDirectory(BootstrapManager bootstrapManager)
          Deprecated. since 3.4, use com.atlassian.confluence.plugin.PluginDirectoryProvider#getPluginTempDirectory If running before bootstrap use getPluginTempDirectory(HomeLocator homeLocator), the homeLocator returns the correct confluence home even if bootstrap hasn't been initialised.
static java.io.File getPluginTempDirectory(com.atlassian.config.HomeLocator homeLocator)
          Deprecated. since 3.4, use com.atlassian.confluence.plugin.PluginDirectoryProvider#getPluginTempDirectory Finds the plugins-temp directory in the confluence home. If it doesn't exist the directory is created.
static
<T> T
instantiatePluginModule(com.atlassian.plugin.Plugin plugin, java.lang.Class<T> cls)
          Instantiates a plugin module.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONFLUENCE_APPLICATION_KEY

@Deprecated
public static final java.lang.String CONFLUENCE_APPLICATION_KEY
Deprecated. since 3.4
See Also:
Constant Field Values

CONFLUENCE_APPLICATION_KEYS

@Deprecated
public static final java.util.Set<java.lang.String> CONFLUENCE_APPLICATION_KEYS
Deprecated. since 3.4

PLUGIN_DESCRIPTOR_FILENAME

public static final java.lang.String PLUGIN_DESCRIPTOR_FILENAME
See Also:
Constant Field Values

PARENT_DIRECTORY_PROPERTY_KEY

public static final java.lang.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

getPluginDirectory

@Deprecated
public static java.io.File getPluginDirectory(BootstrapManager bootstrapManager)
Deprecated. since 3.4, use com.atlassian.confluence.plugin.PluginDirectoryProvider#getPluginDirectory

Parameters:
bootstrapManager - - used to get the confluence home directory
Returns:
the plugin directory

getPluginTempDirectory

@Deprecated
public static java.io.File getPluginTempDirectory(BootstrapManager bootstrapManager)
Deprecated. since 3.4, use com.atlassian.confluence.plugin.PluginDirectoryProvider#getPluginTempDirectory If running before bootstrap use getPluginTempDirectory(HomeLocator homeLocator), the homeLocator returns the correct confluence home even if bootstrap hasn't been initialised.

Parameters:
bootstrapManager - - used to get the confluence home directory
Returns:
the plugin temp directory

getPluginTempDirectory

@Deprecated
public static java.io.File getPluginTempDirectory(com.atlassian.config.HomeLocator homeLocator)
Deprecated. since 3.4, use com.atlassian.confluence.plugin.PluginDirectoryProvider#getPluginTempDirectory Finds the plugins-temp directory in the confluence home. If it doesn't exist the directory is created.

Parameters:
homeLocator - - used to get the confluence home directory
Returns:
the plugin temp directory

getBundledPluginDirectory

@Deprecated
public static java.io.File getBundledPluginDirectory(BootstrapManager bootstrapManager)
Deprecated. since 3.4, use com.atlassian.confluence.plugin.PluginDirectoryProvider#getBundledPluginDirectory If running before bootstrap use getBundledPluginDirectory(HomeLocator homeLocator), the homeLocator returns the correct confluence home even if bootstrap hasn't been initialised.

Parameters:
bootstrapManager - - used to get the confluence home directory
Returns:
the bundled plugin directory

getBundledPluginDirectory

@Deprecated
public static java.io.File getBundledPluginDirectory(com.atlassian.config.HomeLocator homeLocator)
Deprecated. since 3.4, use com.atlassian.confluence.plugin.PluginDirectoryProvider#getBundledPluginDirectory Finds the bundled plugins directory in the confluence home. If it doesn't exist the directory is created.

Parameters:
homeLocator - - used to get the confluence home directory
Returns:
the bundled plugins directory

getPluginsPersistentCacheDirectory

@Deprecated
public static java.io.File getPluginsPersistentCacheDirectory(BootstrapManager bootstrapManager)
Deprecated. since 3.4, use com.atlassian.confluence.plugin.PluginDirectoryProvider#getPluginsPersistentCacheDirectory If running before bootstrap use getBundledPluginDirectory(HomeLocator homeLocator), the homeLocator returns the correct confluence home even if bootstrap hasn't been initialised.

Parameters:
bootstrapManager - - used to get the confluence home directory
Returns:
the plugins persistent cache directory

getPluginsPersistentCacheDirectory

@Deprecated
public static java.io.File getPluginsPersistentCacheDirectory(com.atlassian.config.HomeLocator homeLocator)
Deprecated. since 3.4, use com.atlassian.confluence.plugin.PluginDirectoryProvider#getPluginsPersistentCacheDirectory Finds the plugins persistent cache directory in the confluence home. If it doesn't exist the directory is created.

Parameters:
homeLocator - - used to get the confluence home directory
Returns:
the plugin persistent cache directory

instantiatePluginModule

public static <T> T instantiatePluginModule(com.atlassian.plugin.Plugin plugin,
                                            java.lang.Class<T> cls)
Instantiates a plugin module. First tries to let the plugin autowire the class, if AutowireCapablePlugin 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 java.io.File getPluginsBaseDirectory(java.lang.String homeLocation)

createDirectoryIfDoesntExist

@Deprecated
public static java.io.File createDirectoryIfDoesntExist(java.lang.String directoryLocation)
Deprecated. since 4.0. Use createDirectoryIfDoesntExist(java.io.File), or better still use commons.io.FileUtils.forceMkdir() directly.


createDirectoryIfDoesntExist

public static java.io.File createDirectoryIfDoesntExist(java.io.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


Copyright © 2003-2013 Atlassian. All Rights Reserved.