interface FileSystemInteraction
Utility methods exposed to scripts for interacting with resources (found on the file system or jars) and the file system
Modifiers | Name | Description |
---|---|---|
static class |
FileSystemInteraction.CopySpec |
Type Params | Return Type | Name and description |
---|---|---|
|
abstract String |
className(Resource resource) The class name of the given resource |
|
abstract FileSystemInteraction |
copy(Closure callable) Allows Gradle style simple copy specs |
|
abstract FileSystemInteraction |
copy(Object path, Object destination) Copies a resource to the target destination |
|
abstract FileSystemInteraction |
copy(Resource from, File to) Copy a Resource from the given location to the given directory or location |
|
abstract FileSystemInteraction |
copyAll(Iterable resources, Object destination) Copies resources to the target destination |
|
abstract FileSystemInteraction |
delete(Object path) Deletes a file |
|
abstract File |
file(Object path) Obtain a file for the given path |
|
abstract Collection<File> |
files(String pattern) Get files matching the given pattern |
|
abstract File |
getBuildDir()
|
|
abstract File |
getClassesDir()
|
|
abstract File |
getResourcesDir()
|
|
abstract FileSystemInteraction |
mkdir(Object path) Makes a directory |
|
abstract String |
projectPath(Object path) Obtain the path of the resource relative to the current project |
|
abstract Resource |
resource(Object path) Obtain a resource for the given path |
|
abstract Collection<Resource> |
resources(String pattern) Obtain resources for the given pattern |
|
abstract Resource |
source(String className) Finds a source file for the given class name |
The class name of the given resource
resource
- The resourceAllows Gradle style simple copy specs
callable
- The callableCopies a resource to the target destination
path
- The pathdestination
- The destinationCopy a Resource from the given location to the given directory or location
from
- The resource to copyto
- The location to copy toCopies resources to the target destination
path
- The pathdestination
- The destinationDeletes a file
path
- The path to the fileObtain a file for the given path
path
- The pathGet files matching the given pattern
pattern
- The pattern
Makes a directory
path
- The path to the directoryObtain the path of the resource relative to the current project
path
- The path to inspectObtain a resource for the given path
path
- The pathObtain resources for the given pattern
pattern
- The pattern