@groovy.transform.CompileStatic class FileSystemInteractionImpl extends java.lang.Object implements grails.dev.commands.io.FileSystemInteraction
Utility methods exposed to scripts for interacting with resources (found on the file system or jars) and the file system
Modifiers | Name | Description |
---|---|---|
private java.io.File |
baseDir |
|
private ResourceLoader |
resourceLoader |
|
private ResourceLocator |
resourceLocator |
|
private PathMatchingResourcePatternResolver |
resourcePatternResolver |
Type | Name and description |
---|---|
java.io.File |
baseDir |
org.springframework.core.io.ResourceLoader |
resourceLoader |
ResourceLocator |
resourceLocator |
org.springframework.core.io.support.PathMatchingResourcePatternResolver |
resourcePatternResolver |
Constructor and description |
---|
FileSystemInteractionImpl
(java.io.File baseDir, ResourceLoader resourceLoader) |
Type Params | Return Type | Name and description |
---|---|---|
|
java.lang.String |
className(Resource resource) The class name of the given resource |
|
FileSystemInteractionImpl |
copy(groovy.lang.Closure callable) Allows Gradle style simple copy specs |
|
FileSystemInteractionImpl |
copy(java.lang.Object path, java.lang.Object destination) Copies a resource to the target destination |
|
FileSystemInteractionImpl |
copy(Resource from, java.io.File to) Copy a Resource from the given location to the given directory or location |
|
FileSystemInteractionImpl |
copyAll(java.lang.Iterable resources, java.lang.Object destination) Copies resources to the target destination |
|
FileSystemInteractionImpl |
delete(java.lang.Object path) Deletes a file |
|
java.io.File |
file(java.lang.Object path) Obtain a file for the given path |
|
java.util.Collection<java.io.File> |
files(java.lang.String pattern) Get files matching the given pattern |
|
java.io.File |
getBuildDir()
|
|
java.io.File |
getClassesDir()
|
|
java.io.File |
getResourcesDir()
|
|
FileSystemInteractionImpl |
mkdir(java.lang.Object path) Makes a directory |
|
java.lang.String |
projectPath(java.lang.Object path) Obtain the path of the resource relative to the current project |
|
Resource |
resource(java.lang.Object path) Obtain a resource for the given path |
|
java.util.Collection<Resource> |
resources(java.lang.String pattern) Obtain resources for the given pattern |
|
Resource |
source(java.lang.String className) Finds a source file for the given class name |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
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 patternFinds a source file for the given class name
className
- The class nameGroovy Documentation