@SuppressWarnings('AbstractClassWithoutAbstractMethod') @groovy.transform.CompileStatic abstract class FileSystemOperationsProxy extends Object
Common filesystem operations
| Modifiers | Name | Description |
|---|---|---|
protected File |
projectDir |
The project directory. |
protected java.nio.file.Path |
projectDirPath |
The project directory as java.nio.file.Path. |
protected ProviderFactory |
providerFactory |
Provider factory |
protected File |
rootDir |
The root project directory. |
protected java.nio.file.Path |
rootDirPath |
The project root directory as java.nio.file.Path. |
| Constructor and description |
|---|
protected FileSystemOperationsProxy
(org.ysb33r.grolifant.api.core.ProjectOperations incompleteReference, Project tempProjectReference) |
| Type Params | Return Type | Name and description |
|---|---|---|
|
File |
createTempDirectory(String prefix)Creates a temporary directory with the given prefix. |
|
ConfigurableFileCollection |
files(java.util.Collection<?> files)Converts a file-like objects to File instances with project context. |
|
ConfigurableFileCollection |
filesDropNull(java.util.Collection<?> files)Converts a file-like objects to File instances with project context. |
|
java.util.List<File> |
listDirs(File distDir)Provides a list of directories below another directory |
|
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. |
|
FileTree |
resolveFilesFromCopySpec(CopySpec copySpec)Given a {@Link CopySpec}, resolve all of the input files in to a collection. |
|
String |
toSafeFileName(String name)Converts a string into a string that is safe to use as a file name. |
|
java.nio.file.Path |
toSafePath(String... parts)Converts a collection of String into a java.nio.file.Path with all parts guarantee to be safe file parts |
|
void |
updateFileProperty(Property<File> provider, Object fileTarget)Updates a Property<File>. |
The project directory.
The project directory as java.nio.file.Path.
Provider factory
The root project directory.
The project root directory as java.nio.file.Path.
Creates a temporary directory with the given prefix. Directory will be set to delete on VM exit, but consumers are allowed to delete earlier. The directory will be created somewhere in the build directory.
prefix - Prefix for directory.Converts a file-like objects to File instances with project context.
Converts collections of the following recursively until it gets to a file:
CharSequence including String and GString.
file: schemes.
files - Potential File objectsConverts a file-like objects to File instances with project context.
Converts collections of the following recursively until it gets to a file:
CharSequence including String and GString.
file: schemes.
files - Potential File objectsProvides a list of directories below another directory
distDir - Directorynull
supplied directory.Returns the relative path from the project directory to the given path.
f - Object that is resolvable to a file within project context.null.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.Given a {
copySpec - Input specificationConverts a string into a string that is safe to use as a file name. T The result will only include ascii characters and numbers, and the "-","_", #, $ and "." characters.
name - A potential file nameConverts a collection of String into a java.nio.file.Path with all parts guarantee to be safe file parts
parts - File path parts Updates a Property<File>.
This method deals with a wide range of possibilities and works around the limitations of
Property.set()
provider - Current providerfileTarget - Value that should be lazy-resolved.