Abstracts a number of file operations.
Also Acts as a proxy for the FileSystemOperations
that was implemented in Gradle 6.0,
but allows for a substitute operation on old Gradle versions.
Type Params | Return Type | Name and description |
---|---|---|
|
WorkResult |
copy(Action<? super CopySpec> action) Copies the specified files. |
|
WorkResult |
delete(Action<? super DeleteSpec> action) Deletes the specified files. |
|
File |
file(Object file) Converts a file-like object to a File instance with project context. |
|
File |
fileOrNull(Object file) Similar to {@Link #file}, but does not throw an exception if the object is null or an empty provider. |
|
String |
relativePath(Object f) Returns the relative path from the project directory to the given path. |
|
String |
relativePathToProjectDir(Object f) Returns the relative path from the given path to the project directory. |
|
String |
relativePathToRootDir(Object f) Returns the relative path from the given path to the root project directory. |
|
String |
relativeRootPath(Object f) Returns the relative path from the root project directory to the given path. |
|
WorkResult |
sync(Action<? super CopySpec> action) Synchronizes the contents of a destination directory with some source directories and files. |
Copies the specified files.
action
- Configures a CopySpecDeletes the specified files.
action
- Configures a DeleteSpecConverts a file-like object to a File instance with project context.
Converts any of the following recursively until it gets to a file:
CharSequence
including String
and GString
.
file:
schemes.
file
- Potential File objectSimilar to {
null
or an empty provider.file
- Potential File objectnull
.Returns the relative path from the project directory to the given path.
f
- Object that is resolvable to a file within project contextnull
.Returns the relative path from the given path to the project directory.
f
- Object that is resolvable to a file within project contextnull
.Returns the relative path from the given path to the root project directory.
f
- Object that is resolvable to a file within project contextnull
.Returns the relative path from the root project directory to the given path.
f
- Object that is resolvable to a file within project contextnull
.Synchronizes the contents of a destination directory with some source directories and files.
action
- Action to configure the CopySpec.