PluginPathDiscoverySupport (Grails 2.4.4)
Date: 2014-10-28

Package: org.codehaus.groovy.grails.cli.support

## [Java] Class PluginPathDiscoverySupport

- org.codehaus.groovy.grails.cli.support.PluginPathDiscoverySupport

- Utility methods for plugin discovery when running the Grails command line.

  Authors:
    Graeme Rocher
  Since:
    2.0

- - ### Constructor Summary

    Constructors
    Constructor and description
    `PluginPathDiscoverySupport (BuildSettings settings)`

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `java.io.File` | `getPluginDescriptor(java.io.File dir)` Retrieves the first plugin descriptor it finds in the given directory.
    `java.lang.String` | `getPluginName(java.io.File pluginDir)` Gets the name of a plugin based on its directory.
    `java.util.List<java.io.File>` | `listJarsInPluginLibs()` Lists all the jars found inside a plugins 'lib' directory
    `java.util.List<java.io.File>` | `listKnownPluginDirs()` List all plugin directories that we know about: those in the project's "plugins" directory, those in the global "plugins" dir, and those declared explicitly in the build config.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class java.lang.Object` | `java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()`

- - ### Constructor Detail

    - #### public PluginPathDiscoverySupport(BuildSettings settings)

  - ### Method Detail

    - #### public java.io.File getPluginDescriptor(java.io.File dir)

      Retrieves the first plugin descriptor it finds in the given directory. The search is not recursive.

      Parameters:
        `dir` - The directory to search in.
      Returns:
        The location of the plugin descriptor, or `null` if none can be found.

    - #### public java.lang.String getPluginName(java.io.File pluginDir)

      Gets the name of a plugin based on its directory. The method basically finds the plugin descriptor and uses the name of the class to determine the plugin name. To be honest, this class shouldn't be plugin-aware in my view, so hopefully this will only be a temporary method.

      Parameters:
        `pluginDir` - The directory containing the plugin.
      Returns:
        The name of the plugin contained in the given directory.

    - #### public java.util.List<java.io.File> listJarsInPluginLibs()

      Lists all the jars found inside a plugins 'lib' directory

      Returns:
        A list of plugin jars
      Since:
        2.3

    - #### public java.util.List<java.io.File> listKnownPluginDirs()

      List all plugin directories that we know about: those in the project's "plugins" directory, those in the global "plugins" dir, and those declared explicitly in the build config.

      Returns:
        A list of all known plugin directories, or an empty list if there are none.