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

## org.gradle.api.tasks
[Java] Class Copy

    java.lang.Object
      org.gradle.api.internal.ConventionTask
          org.gradle.api.tasks.AbstractCopyTask
              org.gradle.api.tasks.Copy

    public class Copy
    extends AbstractCopyTask

Copies files into a destination directory. This task can also rename and filter files as it copies. The task implements CopySpec for specifying what to copy.

Examples:

     task mydoc(type:Copy) {
        from 'src/main/doc'
        into 'build/target/doc'
     }

     //for ant filter
     import org.apache.tools.ant.filters.ReplaceTokens

     task initconfig(type:Copy) {
        from('src/main/config') {
           include '**/*.properties'
           include '**/*.xml'
           filter(ReplaceTokens, tokens:[version:'2.3.1'])
        }
        from('src/main/config') {
           exclude '**/*.properties', '**/*.xml'
        }
        from('src/main/languages') {
           rename 'EN_US_(.*)', '$1'
        }
        into 'build/target/config'
        exclude '**/*.bak'

        includeEmptyDirs = false
     }

Authors:
  Steve Appling

Constructor Summary
`Copy()`

Method Summary
`protected void` | `configureRootSpec()`
`FileCopyActionImpl` | `getCopyAction()`
`File` | `getDestinationDir()` Returns the directory to copy files into.
`void` | `setCopyAction(FileCopyActionImpl copyAction)`
`void` | `setDestinationDir(File destinationDir)` Sets the directory to copy files into.

Methods inherited from class AbstractCopyTask
configureRootSpec, copy, eachFile, eachFile, exclude, exclude, exclude, exclude, expand, filter, filter, filter, from, from, getCopyAction, getDefaultSource, getDirMode, getExcludes, getFileMode, getIncludeEmptyDirs, getIncludes, getMainSpec, getRootSpec, getSource, include, include, include, include, into, into, isCaseSensitive, rename, rename, rename, setCaseSensitive, setDirMode, setExcludes, setFileMode, setIncludeEmptyDirs, setIncludes, with

Constructor Detail

### Copy

    public Copy()

Method Detail

### configureRootSpec

    protected void configureRootSpec()

### getCopyAction

    public FileCopyActionImpl getCopyAction()

### getDestinationDir

    @OutputDirectory
    public File getDestinationDir()

  Returns the directory to copy files into.
  Returns:
    The destination dir.

### setCopyAction

    public void setCopyAction(FileCopyActionImpl copyAction)

### setDestinationDir

    public void setDestinationDir(File destinationDir)

  Sets the directory to copy files into. This is the same as calling into(Object) on this task.
  Parameters:
    `destinationDir` - The destination directory. Must not be null.

Gradle API 1.1-rc-1