Package: org.gradle.api.file

## [Java] Interface FileCopyDetails

- org.gradle.api.file.FileCopyDetails

- All Superinterfaces:
    ContentFilterable, FileTreeElement

  Provides details about a file or directory about to be copied, and allows some aspects of the destination file to be modified.

  Using this interface, you can change the destination path of the file, filter the content of the file, or exclude the file from the result entirely.

- - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `void` | `exclude()` Excludes this file from the copy.
    `DuplicatesStrategy` | `getDuplicatesStrategy()` The strategy to use if there is already a file at this file's destination.
    `String` | `getPath()` Returns the path of this file, relative to the root of the copy destination.
    `RelativePath` | `getRelativePath()` Returns the path of this file, relative to the root of the copy destination.
    `void` | `setDuplicatesStrategy(DuplicatesStrategy strategy)` The strategy to use if there is already a file at this file's destination.
    `void` | `setMode(int mode)` Sets the Unix permissions of this file.
    `void` | `setName(String name)` Sets the destination name of this file.
    `void` | `setPath(String path)` Sets the destination path of this file.
    `void` | `setRelativePath(RelativePath path)` Sets the destination path of this file.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `interface ContentFilterable` | `expand, filter, filter, filter`
    `interface FileTreeElement` | `copyTo, copyTo, getFile, getLastModified, getMode, getName, getPath, getRelativePath, getSize, isDirectory, open`

- - ### Method Detail

    - #### public void exclude()

      Excludes this file from the copy.

    - #### @Incubating public DuplicatesStrategy getDuplicatesStrategy()

      The strategy to use if there is already a file at this file's destination.

      The value can be set with a case insensitive string of the enum value (e.g. `'exclude'` for DuplicatesStrategy.EXCLUDE).

      Returns:
        the strategy to use for this file.
      See Also:
        DuplicatesStrategy

    - #### public String getPath()

      Returns the path of this file, relative to the root of the copy destination.

      Always uses '/' as the hierarchy separator, regardless of platform file separator. Same as calling `getRelativePath().getPathString()`.

      Returns:
        The path. Never returns null.

    - #### public RelativePath getRelativePath()

      Returns the path of this file, relative to the root of the copy destination.

      Returns:
        The path. Never returns null.

    - #### @Incubating public void setDuplicatesStrategy(DuplicatesStrategy strategy)

      The strategy to use if there is already a file at this file's destination.

    - #### public void setMode(int mode)

      Sets the Unix permissions of this file.

      Parameters:
        `mode` - the Unix permissions, e.g. `0644`.

    - #### public void setName(String name)

      Sets the destination name of this file.

      Parameters:
        `name` - The name of this file.

    - #### public void setPath(String path)

      Sets the destination path of this file.

      Parameters:
        `path` - The path of this file.

    - #### public void setRelativePath(RelativePath path)

      Sets the destination path of this file.

      Parameters:
        `path` - the new path for this file.