Package org.gradle.api.file
Interface DirectoryProperty
-
@Incubating public interface DirectoryProperty extends Property<Directory>
Represents some configurable directory location, whose value is mutable.You can create a
DirectoryPropertyusingObjectFactory.directoryProperty().Note: This interface is not intended for implementation by build script or plugin authors.
- Since:
- 4.3
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DirectoryPropertyconvention(Directory value)Specifies the value to use as the convention for this property.DirectoryPropertyconvention(Provider<? extends Directory> valueProvider)Specifies the provider of the value to use as the convention for this property.Provider<Directory>dir(String path)Returns aDirectorywhose value is the given path resolved relative to the value of this directory.Provider<Directory>dir(Provider<? extends CharSequence> path)Returns aDirectorywhose value is the given path resolved relative to the value of this directory.Provider<RegularFile>file(String path)Returns aRegularFilewhose value is the given path resolved relative to the value of this directory.Provider<RegularFile>file(Provider<? extends CharSequence> path)Returns aRegularFilewhose value is the given path resolved relative to the value of this directory.Provider<File>getAsFile()Views the location of this directory as aFile.FileTreegetAsFileTree()Returns aFileTreethat allows the files and directories contained in this directory to be queried.voidset(File dir)Sets the location of this directory.DirectoryPropertyvalue(Directory value)Sets the value of the property the given value, replacing whatever value the property already had.-
Methods inherited from interface org.gradle.api.provider.Property
finalizeValue, set, set
-
-
-
-
Method Detail
-
getAsFileTree
FileTree getAsFileTree()
Returns aFileTreethat allows the files and directories contained in this directory to be queried.
-
set
void set(File dir)
Sets the location of this directory.
-
value
DirectoryProperty value(Directory value)
Sets the value of the property the given value, replacing whatever value the property already had.This is the same as
Property.set(Object)but returns this property to allow method chaining.
-
convention
DirectoryProperty convention(Directory value)
Specifies the value to use as the convention for this property. The convention is used when no value has been set for this property.- Specified by:
conventionin interfaceProperty<Directory>- Parameters:
value- The value.- Returns:
- this
-
convention
DirectoryProperty convention(Provider<? extends Directory> valueProvider)
Specifies the provider of the value to use as the convention for this property. The convention is used when no value has been set for this property.- Specified by:
conventionin interfaceProperty<Directory>- Parameters:
valueProvider- The provider of the value.- Returns:
- this
-
dir
Provider<Directory> dir(String path)
Returns aDirectorywhose value is the given path resolved relative to the value of this directory.- Parameters:
path- The path. Can be absolute.- Returns:
- The directory.
-
dir
Provider<Directory> dir(Provider<? extends CharSequence> path)
Returns aDirectorywhose value is the given path resolved relative to the value of this directory.- Parameters:
path- The path. Can have a value that is an absolute path.- Returns:
- The directory.
-
file
Provider<RegularFile> file(String path)
Returns aRegularFilewhose value is the given path resolved relative to the value of this directory.- Parameters:
path- The path. Can be absolute.- Returns:
- The file.
-
file
Provider<RegularFile> file(Provider<? extends CharSequence> path)
Returns aRegularFilewhose value is the given path resolved relative to the value of this directory.- Parameters:
path- The path. Can have a value that is an absolute path.- Returns:
- The file.
-
-