Package org.gradle.api.file

## Interface CopyProcessingSpec

- All Superinterfaces:
    `ContentFilterable`
  All Known Subinterfaces:
    `CopySpec`, `SyncSpec`
  All Known Implementing Classes:
    `AbstractArchiveTask`, `AbstractCopyTask`, `Copy`, `Ear`, `Jar`, `Jar`, `ProcessResources`, `Sync`, `Tar`, `War`, `Zip`

      public interface CopyProcessingSpec
      extends ContentFilterable

  Specifies the destination of a copy.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `CopyProcessingSpec` | `dirPermissions​(Action<? super ConfigurableFilePermissions> configureAction)` | Configuration action for specifying directory access permissions.
    `CopyProcessingSpec` | `eachFile​(Closure closure)` | Adds an action to be applied to each file as it about to be copied into its destination.
    `CopyProcessingSpec` | `eachFile​(Action<? super FileCopyDetails> action)` | Adds an action to be applied to each file as it is about to be copied into its destination.
    `CopyProcessingSpec` | `filePermissions​(Action<? super ConfigurableFilePermissions> configureAction)` | Configuration action for specifying file access permissions.
    `java.lang.Integer` | `getDirMode()` | Returns the Unix permissions to use for the target directories.
    `Property<ConfigurableFilePermissions>` | `getDirPermissions()` | Property for configuring directory access permissions.
    `java.lang.Integer` | `getFileMode()` | Returns the Unix permissions to use for the target files.
    `Property<ConfigurableFilePermissions>` | `getFilePermissions()` | Property for configuring file access permissions.
    `CopyProcessingSpec` | `into​(java.lang.Object destPath)` | Specifies the destination directory for a copy.
    `CopyProcessingSpec` | `rename​(Closure closure)` | Renames a source file.
    `CopyProcessingSpec` | `rename​(java.lang.String sourceRegEx, java.lang.String replaceWith)` | Renames files based on a regular expression.
    `CopyProcessingSpec` | `rename​(java.util.regex.Pattern sourceRegEx, java.lang.String replaceWith)` | Renames files based on a regular expression.
    `CopyProcessingSpec` | `rename​(Transformer<@Nullable java.lang.String,​java.lang.String> renamer)` | Renames a source file.
    `CopyProcessingSpec` | `setDirMode​(java.lang.Integer mode)` | Sets the Unix permissions to use for the target directories.
    `CopyProcessingSpec` | `setFileMode​(java.lang.Integer mode)` | Sets the Unix permissions to use for the target files.

    - ### Methods inherited from interface org.gradle.api.file.ContentFilterable

      `expand, expand, filter, filter, filter, filter`

- - ### Method Detail

    - #### into

          CopyProcessingSpec into​(java.lang.Object destPath)

      Specifies the destination directory for a copy. The destination is evaluated as per `Project.file(Object)`.
      Parameters:
        `destPath` - Path to the destination directory for a Copy
      Returns:
        this

    - #### rename

          CopyProcessingSpec rename​(Closure closure)

      Renames a source file. The closure will be called with a single parameter, the name of the file. The closure should return a String object with a new target name. The closure may return null, in which case the original name will be used.
      Parameters:
        `closure` - rename closure
      Returns:
        this

    - #### rename

          CopyProcessingSpec rename​(Transformer<@Nullable java.lang.String,​java.lang.String> renamer)

      Renames a source file. The function will be called with a single parameter, the name of the file. The function should return a new target name. The function may return null, in which case the original name will be used.
      Parameters:
        `renamer` - rename function
      Returns:
        this

    - #### rename

          CopyProcessingSpec rename​(java.lang.String sourceRegEx,
                                    java.lang.String replaceWith)

      Renames files based on a regular expression. Uses java.util.regex type of regular expressions. Note that the replace string should use the '$1' syntax to refer to capture groups in the source regular expression. Files that do not match the source regular expression will be copied with the original name.

      Example:

           rename '(.*)_OEM_BLUE_(.*)', '$1$2'

      would map the file 'style_OEM_BLUE_.css' to 'style.css'
      Parameters:
        `sourceRegEx` - Source regular expression
        `replaceWith` - Replacement string (use $ syntax for capture groups)
      Returns:
        this

    - #### rename

          CopyProcessingSpec rename​(java.util.regex.Pattern sourceRegEx,
                                    java.lang.String replaceWith)

      Renames files based on a regular expression. See `rename(String, String)`.
      Parameters:
        `sourceRegEx` - Source regular expression
        `replaceWith` - Replacement string (use $ syntax for capture groups)
      Returns:
        this

    - #### getFileMode

          @Nullable
          java.lang.Integer getFileMode()

      Returns the Unix permissions to use for the target files. `null` means that existing permissions are preserved. It is dependent on the copy action implementation whether these permissions will actually be applied.
      Returns:
        The file permissions, or `null` if existing permissions should be preserved.
      API Note:
        Consider using `getFilePermissions()` instead.

    - #### setFileMode

          CopyProcessingSpec setFileMode​(@Nullable
                                         java.lang.Integer mode)

      Sets the Unix permissions to use for the target files. `null` means that existing permissions are preserved. It is dependent on the copy action implementation whether these permissions will actually be applied.
      Parameters:
        `mode` - The file permissions.
      Returns:
        this
      API Note:
        Consider using `filePermissions(Action)` instead.

    - #### getDirMode

          @Nullable
          java.lang.Integer getDirMode()

      Returns the Unix permissions to use for the target directories. `null` means that existing permissions are preserved. It is dependent on the copy action implementation whether these permissions will actually be applied.
      Returns:
        The directory permissions, or `null` if existing permissions should be preserved.
      API Note:
        Consider using `getDirPermissions()` instead.

    - #### setDirMode

          CopyProcessingSpec setDirMode​(@Nullable
                                        java.lang.Integer mode)

      Sets the Unix permissions to use for the target directories. `null` means that existing permissions are preserved. It is dependent on the copy action implementation whether these permissions will actually be applied.
      Parameters:
        `mode` - The directory permissions.
      Returns:
        this
      API Note:
        Consider using `dirPermissions(Action)` instead.

    - #### getFilePermissions

          @Incubating
          Property<ConfigurableFilePermissions> getFilePermissions()

      Property for configuring file access permissions. For details see `ConfigurableFilePermissions`.
      Since:
        8.3

    - #### filePermissions

          @Incubating
          CopyProcessingSpec filePermissions​(Action<? super ConfigurableFilePermissions> configureAction)

      Configuration action for specifying file access permissions. For details see `ConfigurableFilePermissions`.
      Since:
        8.3

    - #### getDirPermissions

          @Incubating
          Property<ConfigurableFilePermissions> getDirPermissions()

      Property for configuring directory access permissions. For details see `ConfigurableFilePermissions`.
      Since:
        8.3

    - #### dirPermissions

          @Incubating
          CopyProcessingSpec dirPermissions​(Action<? super ConfigurableFilePermissions> configureAction)

      Configuration action for specifying directory access permissions. For details see `ConfigurableFilePermissions`.
      Since:
        8.3

    - #### eachFile

          CopyProcessingSpec eachFile​(Action<? super FileCopyDetails> action)

      Adds an action to be applied to each file as it is about to be copied into its destination. The action can change the destination path of the file, filter the contents of the file, or exclude the file from the result entirely. Actions are executed in the order added, and are inherited from the parent spec.
      Parameters:
        `action` - The action to execute.
      Returns:
        this

    - #### eachFile

          CopyProcessingSpec eachFile​(@DelegatesTo(value=FileCopyDetails.class,strategy=1)
                                      Closure closure)

      Adds an action to be applied to each file as it about to be copied into its destination. The given closure is called with a `FileCopyDetails` as its parameter. Actions are executed in the order added, and are inherited from the parent spec.
      Parameters:
        `closure` - The action to execute.
      Returns:
        this