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

## org.gradle.api.file
Interface CopySpec

    org.gradle.api.file.CopySourceSpec
      org.gradle.api.file.CopySpec

All Superinterfaces:
  CopySourceSpec

    interface CopySpec
    extends CopySourceSpec

A set of specifications for copying files. This includes:

- source directories (multiples allowed)
- destination directory
- ANT like include patterns
- ANT like exclude patterns
- File relocating rules
- renaming rules
- content filters

CopySpecs may be nested by passing a closure to one of the from methods. The closure creates a child CopySpec and delegates methods in the closure to the child. Child CopySpecs inherit any values specified in the parent. Only the leaf CopySpecs will be used in any copy operations. This allows constructs like:

     into('webroot')
     exclude('**/.svn/**')
     from('src/main/webapp') {
        include '**/*.jsp'
     }
     from('src/main/js') {
        include '**/*.js'
     }

In this example, the `into` and `exclude` specifications at the root level are inherited by the two child CopySpecs.

author:
  Steve Appling

see:
  org.gradle.api.tasks.Copy Copy Task

see:
  org.gradle.api.Project#copy(groovy.lang.Closure) Project.copy()

Method Summary
`CopySpec` | `exclude(java.lang.String excludes)` {
`CopySpec` | `exclude(java.lang.Iterable excludes)` {
`CopySpec` | `filter(Map map, java.lang.Class filterType)` {
`CopySpec` | `filter(java.lang.Class filterType)` {
`CopySpec` | `filter(Closure closure)` {
`CopySpec` | `from(java.lang.Object sourcePaths)` {
`CopySpec` | `from(java.lang.Object sourcePath, Closure c)` {
`CopySpec` | `include(java.lang.String includes)` {
`CopySpec` | `include(java.lang.Iterable includes)` {
`CopySpec` | `into(java.lang.Object destPath)` {
`CopySpec` | `remapTarget(Closure closure)` {
`CopySpec` | `rename(java.lang.String sourceRegEx, java.lang.String replaceWith)` {
`CopySpec` | `setExcludes(java.lang.Iterable excludes)` {
`CopySpec` | `setIncludes(java.lang.Iterable includes)` {

Methods inherited from interface CopySourceSpec
from, from

Method Detail

### exclude

    public CopySpec exclude(java.lang.String excludes)

  {@inheritDoc}
  see:
    org.gradle.api.tasks.util.PatternFilterable Pattern Format

### exclude

    public CopySpec exclude(java.lang.Iterable excludes)

  {@inheritDoc}
  see:
    org.gradle.api.tasks.util.PatternFilterable Pattern Format

### filter

    public CopySpec filter(Map map, java.lang.Class filterType)

  {@inheritDoc}

### filter

    public CopySpec filter(java.lang.Class filterType)

  {@inheritDoc}

### filter

    public CopySpec filter(Closure closure)

  {@inheritDoc}

### from

    public CopySpec from(java.lang.Object sourcePaths)

  {@inheritDoc}

### from

    public CopySpec from(java.lang.Object sourcePath, Closure c)

  {@inheritDoc}

### include

    public CopySpec include(java.lang.String includes)

  {@inheritDoc}
  see:
    org.gradle.api.tasks.util.PatternFilterable Pattern Format

### include

    public CopySpec include(java.lang.Iterable includes)

  {@inheritDoc}
  see:
    org.gradle.api.tasks.util.PatternFilterable Pattern Format

### into

    public CopySpec into(java.lang.Object destPath)

  {@inheritDoc}

### remapTarget

    public CopySpec remapTarget(Closure closure)

  {@inheritDoc}

### rename

    public CopySpec rename(java.lang.String sourceRegEx, java.lang.String replaceWith)

  {@inheritDoc}

### setExcludes

    public CopySpec setExcludes(java.lang.Iterable excludes)

  {@inheritDoc}
  see:
    org.gradle.api.tasks.util.PatternFilterable Pattern Format

### setIncludes

    public CopySpec setIncludes(java.lang.Iterable includes)

  {@inheritDoc}
  see:
    org.gradle.api.tasks.util.PatternFilterable Pattern Format

Groovy Documentation