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

java.lang.Object
  extended by org.codehaus.groovy.grails.cli.support.PluginPathDiscoverySupport

public class PluginPathDiscoverySupport
extends java.lang.Object

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

Since:
2.0

Constructor Summary
PluginPathDiscoverySupport(grails.util.BuildSettings settings)
           
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PluginPathDiscoverySupport

public PluginPathDiscoverySupport(grails.util.BuildSettings settings)
Method Detail

listKnownPluginDirs

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.

listJarsInPluginLibs

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

getPluginName

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.

getPluginDescriptor

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.