Schnittstelle FileCopyDetails
- Alle Superschnittstellen:
ContentFilterable,Describable,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.
Access to the source file itself after any filters have been added is not a supported operation.
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidexclude()Excludes this file from the copy.The strategy to use if there is already a file at this file's destination.getName()Returns the base name of this file at the copy destination.getPath()Returns the path of this file, relative to the root of the copy destination.Returns the path of this file, relative to the root of the copy destination.Returns the path of this file, relative to the root of the containing file tree.Returns the base name of this file at the copy source.Returns the path of this file, relative to the root of the containing file tree.voidpermissions(Action<? super ConfigurableFilePermissions> configureAction) Configuration action for specifying file and directory access permissions.voidsetDuplicatesStrategy(DuplicatesStrategy strategy) The strategy to use if there is already a file at this file's destination.voidsetMode(int mode) Veraltet.voidSets the destination name of this file.voidSets the destination path of this file.voidsetPermissions(FilePermissions permissions) Set file and directory access permissions based on an externally provided permission instance.voidsetRelativePath(RelativePath path) Sets the destination path of this file.Von Schnittstelle geerbte Methoden org.gradle.api.file.ContentFilterable
expand, expand, filter, filter, filter, filterVon Schnittstelle geerbte Methoden org.gradle.api.Describable
getDisplayNameVon Schnittstelle geerbte Methoden org.gradle.api.file.FileTreeElement
copyTo, copyTo, getFile, getLastModified, getMode, getPermissions, getSize, isDirectory, open
-
Methodendetails
-
exclude
void exclude()Excludes this file from the copy. -
setName
Sets the destination name of this file.- Parameter:
name- The destination name of this file.
-
setPath
Sets the destination path of this file.- Parameter:
path- The path of this file.
-
setRelativePath
Sets the destination path of this file.- Parameter:
path- the new path for this file.
-
setMode
Veraltet.Usepermissions(Action)instead. This method is scheduled for removal in Gradle 9.0.Sets the Unix permissions of this file.- Parameter:
mode- the Unix permissions, e.g.0644.
-
permissions
Configuration action for specifying file and directory access permissions. For details seeConfigurableFilePermissions.- Seit:
- 8.3
-
setPermissions
Set file and directory access permissions based on an externally provided permission instance. For details seeConfigurableFilePermissions.- Seit:
- 8.3
-
setDuplicatesStrategy
The strategy to use if there is already a file at this file's destination. -
getDuplicatesStrategy
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'forDuplicatesStrategy.EXCLUDE).- Gibt zurück:
- the strategy to use for this file.
- Siehe auch:
-
getName
String getName()Returns the base name of this file at the copy destination.- Angegeben von:
getNamein SchnittstelleFileTreeElement- Gibt zurück:
- The destination name. Never returns null.
-
getPath
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().- Angegeben von:
getPathin SchnittstelleFileTreeElement- Gibt zurück:
- The path, relative to the root of the copy destination. Never returns null.
-
getRelativePath
RelativePath getRelativePath()Returns the path of this file, relative to the root of the copy destination.- Angegeben von:
getRelativePathin SchnittstelleFileTreeElement- Gibt zurück:
- The path, relative to the root of the copy destination. Never returns null.
-
getSourceName
String getSourceName()Returns the base name of this file at the copy source.- Gibt zurück:
- The source name. Never returns null.
-
getSourcePath
String getSourcePath()Returns the path of this file, relative to the root of the containing file tree.Always uses '/' as the hierarchy separator, regardless of platform file separator. Same as calling
getRelativeSourcePath().getPathString().- Gibt zurück:
- The path, relative to the root of the containing file tree. Never returns null.
-
getRelativeSourcePath
RelativePath getRelativeSourcePath()Returns the path of this file, relative to the root of the containing file tree.- Gibt zurück:
- The path, relative to the root of the containing file tree. Never returns null.
-
permissions(Action)instead.