Overview | Package | Class | Deprecated | Index | Help
| Groovy Documentation
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.codehaus.groovy.grails.cli.api
[Java] Class BaseSettingsApi

    java.lang.Object
      org.codehaus.groovy.grails.cli.api.BaseSettingsApi

    public class BaseSettingsApi
    extends java.lang.Object

Utility methods used on the command line.

Authors:
  Graeme Rocher

Field Summary
`protected java.lang.Object` | `appClassName`
`protected GrailsBuildEventListener` | `buildEventListener`
`protected java.util.Properties` | `buildProps`
`protected BuildSettings` | `buildSettings`
`protected groovy.util.ConfigSlurper` | `configSlurper`
`protected boolean` | `enableProfile`
`protected java.lang.String` | `grailsAppName`
`protected java.io.File` | `grailsHome`
`protected boolean` | `isInteractive`
`protected Metadata` | `metadata`
`protected java.io.File` | `metadataFile`
`protected PluginBuildSettings` | `pluginSettings`
`protected java.lang.String` | `pluginsHome`
`protected PathMatchingResourcePatternResolver` | `resolver`

Constructor Summary
`BaseSettingsApi(BuildSettings buildSettings, boolean interactive)`
`BaseSettingsApi(BuildSettings settings, GrailsBuildEventListener buildEventListener, boolean interactive)`

Method Summary
`boolean` | `confirmInput(java.lang.String message, java.lang.String code)` Interactive prompt that can be used by any part of the build.
`boolean` | `confirmInput(java.lang.String message)`
`void` | `copyGrailsResource(java.lang.Object targetFile, Resource resource)` Copies a Spring resource to the file system.
`void` | `copyGrailsResource(java.lang.Object targetFile, Resource resource, boolean overwrite)`
`void` | `copyGrailsResources(java.lang.Object destDir, java.lang.Object pattern)`
`void` | `copyGrailsResources(java.lang.Object destDir, java.lang.Object pattern, boolean overwrite)`
`void` | `enableUaa()`
`void` | `exit(int code)`
`java.lang.Object` | `getAppClassName()`
`java.lang.String` | `getAppGrailsVersion()`
`java.util.Properties` | `getBuildProps()`
`BuildSettings` | `getBuildSettings()`
`groovy.util.ConfigSlurper` | `getConfigSlurper()`
`java.lang.String` | `getGrailsAppName()`
`java.lang.String` | `getGrailsAppVersion()`
`java.io.File` | `getGrailsHome()`
`boolean` | `getIsInteractive()`
`Metadata` | `getMetadata()`
`java.io.File` | `getMetadataFile()`
`PluginBuildSettings` | `getPluginBuildSettings()`
`PluginBuildSettings` | `getPluginSettings()`
`java.lang.String` | `getPluginsHome()`
`java.lang.Object` | `getPropertyValue(java.lang.String propName, java.lang.Object defaultValue)` Resolves the value for a given property name.
`PathMatchingResourcePatternResolver` | `getResolver()`
`java.lang.String` | `getServerHost()`
`int` | `getServerPort()`
`int` | `getServerPortHttps()`
`java.lang.String` | `getServletVersion()`
`Resource` | `grailsResource(java.lang.String path)` Closure that returns a Spring Resource - either from $GRAILS_HOME if that is set, or from the classpath.
`protected boolean` | `isDeclared(java.lang.Object cla, java.lang.reflect.Method readMethod)`
`boolean` | `isEnableProfile()`
`void` | `logError(java.lang.String message, java.lang.Throwable t)`
`void` | `logErrorAndExit(java.lang.String message, java.lang.Throwable t)`
`void` | `makeApiAvailableToScripts(org.codehaus.gant.GantBinding binding, java.lang.Object cla)`
`java.lang.String` | `makeRelative(java.lang.String path)`
`java.lang.String` | `makeRelative(java.io.File file)` Exits the build immediately with a given exit code.
`void` | `profile(java.lang.String name, groovy.lang.Closure callable)` Times the execution of a closure, which can include a target.
`java.util.List` | `readAllPluginXmlMetadata()` Reads all installed plugin descriptors returning a list
`groovy.util.slurpersupport.GPathResult` | `readPluginXmlMetadata(java.lang.String pluginName)`
`Resource[]` | `resolveResources(java.lang.String pattern)`
`void` | `updateMetadata(Metadata metadata, java.util.Map entries)`
`void` | `updateMetadata(java.util.Map entries)` Modifies the application's metadata, as stored in the "application.properties" file.

Methods inherited from class java.lang.Object
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), 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()

Field Detail

### appClassName

    protected java.lang.Object appClassName

### buildEventListener

    protected GrailsBuildEventListener buildEventListener

### buildProps

    protected java.util.Properties buildProps

### buildSettings

    protected BuildSettings buildSettings

### configSlurper

    protected groovy.util.ConfigSlurper configSlurper

### enableProfile

    protected boolean enableProfile

### grailsAppName

    protected java.lang.String grailsAppName

### grailsHome

    protected java.io.File grailsHome

### isInteractive

    protected boolean isInteractive

### metadata

    protected Metadata metadata

### metadataFile

    protected java.io.File metadataFile

### pluginSettings

    protected PluginBuildSettings pluginSettings

### pluginsHome

    protected java.lang.String pluginsHome

### resolver

    protected PathMatchingResourcePatternResolver resolver

Constructor Detail

### BaseSettingsApi

    public BaseSettingsApi(BuildSettings buildSettings, boolean interactive)

### BaseSettingsApi

    public BaseSettingsApi(BuildSettings settings, GrailsBuildEventListener buildEventListener, boolean interactive)

Method Detail

### confirmInput

    public boolean confirmInput(java.lang.String message, java.lang.String code)

  Interactive prompt that can be used by any part of the build. Echos the given message to the console and waits for user input that matches either 'y' or 'n'. Returns `true` if the user enters 'y', `false` otherwise.

### confirmInput

    public boolean confirmInput(java.lang.String message)

### copyGrailsResource

    public void copyGrailsResource(java.lang.Object targetFile, Resource resource)

  Copies a Spring resource to the file system.

### copyGrailsResource

    public void copyGrailsResource(java.lang.Object targetFile, Resource resource, boolean overwrite)

### copyGrailsResources

    public void copyGrailsResources(java.lang.Object destDir, java.lang.Object pattern)

### copyGrailsResources

    public void copyGrailsResources(java.lang.Object destDir, java.lang.Object pattern, boolean overwrite)

### enableUaa

    public void enableUaa()

### exit

    public void exit(int code)

### getAppClassName

    public java.lang.Object getAppClassName()

### getAppGrailsVersion

    public java.lang.String getAppGrailsVersion()

### getBuildProps

    public java.util.Properties getBuildProps()

### getBuildSettings

    public BuildSettings getBuildSettings()

### getConfigSlurper

    public groovy.util.ConfigSlurper getConfigSlurper()

### getGrailsAppName

    public java.lang.String getGrailsAppName()

### getGrailsAppVersion

    public java.lang.String getGrailsAppVersion()

### getGrailsHome

    public java.io.File getGrailsHome()

### getIsInteractive

    public boolean getIsInteractive()

### getMetadata

    public Metadata getMetadata()

### getMetadataFile

    public java.io.File getMetadataFile()

### getPluginBuildSettings

    public PluginBuildSettings getPluginBuildSettings()

### getPluginSettings

    public PluginBuildSettings getPluginSettings()

### getPluginsHome

    public java.lang.String getPluginsHome()

### getPropertyValue

    public java.lang.Object getPropertyValue(java.lang.String propName, java.lang.Object defaultValue)

  Resolves the value for a given property name. It first looks for a system property, then in the BuildSettings configuration, and finally uses the given default value if other options are exhausted.

### getResolver

    public PathMatchingResourcePatternResolver getResolver()

### getServerHost

    public java.lang.String getServerHost()

### getServerPort

    public int getServerPort()

### getServerPortHttps

    public int getServerPortHttps()

### getServletVersion

    public java.lang.String getServletVersion()

### grailsResource

    public Resource grailsResource(java.lang.String path)

  Closure that returns a Spring Resource - either from $GRAILS_HOME if that is set, or from the classpath.

### isDeclared

    protected boolean isDeclared(java.lang.Object cla, java.lang.reflect.Method readMethod)

### isEnableProfile

    public boolean isEnableProfile()

### logError

    public void logError(java.lang.String message, java.lang.Throwable t)

### logErrorAndExit

    public void logErrorAndExit(java.lang.String message, java.lang.Throwable t)

### makeApiAvailableToScripts

    public void makeApiAvailableToScripts(org.codehaus.gant.GantBinding binding, java.lang.Object cla)

### makeRelative

    public java.lang.String makeRelative(java.lang.String path)

### makeRelative

    public java.lang.String makeRelative(java.io.File file)

  Exits the build immediately with a given exit code.

### profile

    public void profile(java.lang.String name, groovy.lang.Closure callable)

  Times the execution of a closure, which can include a target. For example, profile("compile", compile) where 'compile' is the target.

### readAllPluginXmlMetadata

    public java.util.List readAllPluginXmlMetadata()

  Reads all installed plugin descriptors returning a list

### readPluginXmlMetadata

    public groovy.util.slurpersupport.GPathResult readPluginXmlMetadata(java.lang.String pluginName)

### resolveResources

    public Resource[] resolveResources(java.lang.String pattern)

### updateMetadata

    public void updateMetadata( Metadata metadata,  java.util.Map entries)

### updateMetadata

    public void updateMetadata(= pluginSettings.getPluginDir java.util.Map entries)

  Modifies the application's metadata, as stored in the "application.properties" file. If it doesn't exist, the file is created.

Groovy Documentation