Interface DirectoryProperty
- All Superinterfaces:
- FileSystemLocationProperty<Directory>,- HasConfigurableValue,- Property<Directory>,- Provider<Directory>,- SupportsConvention
 You can create a DirectoryProperty using ObjectFactory.directoryProperty().
 
Note: This interface is not intended for implementation by build script or plugin authors.
- Since:
- 4.3
- 
Method SummaryModifier and TypeMethodDescriptionconvention(Directory value) Specifies the value to use as the convention (default value) for this property.convention(Provider<? extends Directory> provider) Specifies the provider to be used to query the convention (default value) for this property.Returns aDirectorywhose value is the given path resolved relative to the value of this directory.dir(Provider<? extends CharSequence> path) Returns aDirectorywhose value is the given path resolved relative to the value of this directory.Returns aRegularFilewhose value is the given path resolved relative to the value of this directory.file(Provider<? extends CharSequence> path) Returns aRegularFilewhose value is the given path resolved relative to the value of this directory.fileProvider(Provider<File> provider) Returns aFileCollectioncontaining the given files, whose locations are the given paths resolved relative to this directory, as defined byProject.files(Object...).Sets the location of this file, using aFileinstance.Returns aFileTreethat allows the files and directories contained in this directory to be queried.Sets the value of the property to the given value, replacing whatever value the property already had.Sets the property to have the same value as the given provider, replacing whatever value the property already had.Methods inherited from interface org.gradle.api.file.FileSystemLocationPropertygetAsFile, getLocationOnly, setMethods inherited from interface org.gradle.api.provider.HasConfigurableValuedisallowChanges, disallowUnsafeRead, finalizeValueOnReadMethods inherited from interface org.gradle.api.provider.PropertyfinalizeValue, set, set, unset, unsetConvention
- 
Method Details- 
getAsFileTreeFileTree getAsFileTree()Returns aFileTreethat allows the files and directories contained in this directory to be queried.
- 
valueSets the value of the property to the given value, replacing whatever value the property already had. This is the same asProperty.set(Object)but returns this property to allow method chaining.This method can also be used to discard the value of the property, by passing it null. When the value is discarded (or has never been set in the first place), the convention (default value) for this property, if specified, will be used to provide the value instead.
- 
valueSets the property to have the same value as the given provider, replacing whatever value the property already had. This property will track the value of the provider and query its value each time the value of the property is queried. When the provider has no value, this property will also have no value. This is the same asProperty.set(Provider)but returns this property to allow method chaining.This method can NOT be used to discard the value of the property. Specifying a nullprovider will result in anIllegalArgumentExceptionbeing thrown. When the provider has no value, this property will also have no value - regardless of whether or not a convention has been set.When the given provider represents a task output, this property will also carry the task dependency information from the provider. 
- 
fileValueSets the location of this file, using aFileinstance.Fileinstances with relative paths are resolved relative to the project directory of the project that owns this property instance.This method is the same as FileSystemLocationProperty.set(File)but allows method chaining.- Specified by:
- fileValuein interface- FileSystemLocationProperty<Directory>
- Returns:
- this
 
- 
fileProviderSets the location of this file, using aFileProviderinstance.Fileinstances with relative paths are resolved relative to the project directory of the project that owns this property instance.- Specified by:
- fileProviderin interface- FileSystemLocationProperty<Directory>
- Returns:
- this
 
- 
conventionSpecifies the value to use as the convention (default value) for this property. If the convention is set and no explicit value or value provider has been specified, then the convention will be returned as the value of the property (when queried).This method can be used to specify that the property does not have a default value, by passing it null.- Specified by:
- conventionin interface- Property<Directory>
- Parameters:
- value- The convention value, or- nullif the property should have no default value.
- Returns:
- this
 
- 
conventionSpecifies the provider to be used to query the convention (default value) for this property. If a convention provider has been set and no explicit value or value provider has been specified, then the convention provider's value will be returned as the value of the property (when queried).The property's convention tracks the convention provider. Whenever the convention's actual value is needed, the convention provider will be queried anew. This method can't be used to specify that a property does not have a default value. Passing in a nullprovider will result in anIllegalArgumentExceptionbeing thrown. When the provider doesn't have a value, then the property will behave as if it wouldn't have a convention specified.- Specified by:
- conventionin interface- Property<Directory>
- Parameters:
- provider- The provider of the property's convention value, can't be null.
- Returns:
- this
 
- 
dirReturns aDirectorywhose value is the given path resolved relative to the value of this directory.- Parameters:
- path- The path. Can be absolute.
- Returns:
- The directory.
 
- 
dirReturns 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.
 
- 
fileReturns aRegularFilewhose value is the given path resolved relative to the value of this directory.- Parameters:
- path- The path. Can be absolute.
- Returns:
- The file.
 
- 
fileReturns 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.
 
- 
filesReturns aFileCollectioncontaining the given files, whose locations are the given paths resolved relative to this directory, as defined byProject.files(Object...). This method can also be used to create an empty collection, but the collection may not be mutated later.- Parameters:
- paths- The paths to the files. May be empty.
- Returns:
- The file collection.
- Since:
- 6.0
 
 
-