saker.build Documentation TaskDoc JavaDoc Packages
public class ForwardingTaskContext implements TaskContext, TaskExecutionUtilities
TaskContext and TaskExecutionUtilities implementation that forwards its calls to a concrete implementation.

Clients may extend this class. New methods may and will be added in the future.

Fields
protected final TaskContext
The concrete TaskContext.
protected final TaskExecutionUtilities
Constructors
public
Creates a new instance initialized with the task context which to forward the calls.
Methods
public void
Signals an error during the execution of this task to the build runtime.
public void
Acquires the execution-wide lock for accessing the standard I/O.
public SakerFile
Adds a file to the specified directory.
public SakerFile
Add a file to the specified directory only if there is no file present yet with the same name.
public SakerFile
Add a file to the specified directory only if there is no directory present with the same name.
public void
Add and synchronizes a SakerFile to the specified directory with the given name that has its contents backed by the given path key.
public NavigableMap<SakerPath, SakerFile>
Collects the files for the given file collection strategy.
public NavigableMap<SakerPath, SakerFile>
public NavigableMap<SakerPath, SakerFile>
Collects the files for the given addition dependency, and reports it.
public NavigableMap<SakerPath, SakerFile>
public NavigableMap<SakerPath, SakerFile>
Collects the files for the given file addition dependency, and reports it and the files as dependencies.
public <T> T
Computes some data based on a contents of a file.
public SakerFile
Creates a SakerFile instance which has its contents backed by the specified file system file at the given path.
public SakerFile
createProviderPathFile(String name, ProviderHolderPathKey pathkey, ContentDescriptor currentpathcontentdescriptor)
Creates a SakerFile instance which has its contents backed by the specified file system file at the given path, and associates the argument content descriptor with the current contents.
public SakerFile
Creates a SakerFile instance which has its contents backed by the specified file system file at the given path.
public SakerFile
Creates a SakerFile instance which has its contents backed by the specified file system file at the given path, and associates the argument content descriptor and posix file permissions with the current contents.
public ByteArrayRegion
Gets the raw contents of the file as a byte array.
public NavigableMap<String, ContentDescriptor>
Gets the content descriptors of the children of the specified directory.
public String
Gets the contents of the file as a String.
public ExecutionContext
Gets the execution context which is used to run this task.
public TaskFileDeltas
Gets a file delta collection for all possible file delta types.
public TaskFileDeltas
Gets a file delta collection for the given delta type.
public Set<extends BuildDelta>
Gets the set of deltas which contain no file deltas.
public NavigableMap<SakerPath, SakerFile>
Gets the current state of collected files for a previously reported file addition dependency.
public NavigableMap<SakerPath, ? extends SakerFile>
Gets the current state of previously reported file input dependencies for a given tag.
public NavigableMap<SakerPath, ? extends SakerFile>
Gets the current state of previously reported file output dependencies for a given tag.
public <T> T
Gets the output of the task from the previous run.
public <T> T
Gets the previously set task output for the given tag.
public TaskProgressMonitor
Gets the progress monitor for this task.
public <T> T
Gets the current value of the specified environment property and reports it as a dependency.
public <T> T
Gets the current value of the specified execution property and reports it as a dependency.
public SecretInputReader
Gets the input reader that can be used to read secret input from the user.
public ByteSink
Gets the standard error for this task.
public ByteSource
Gets the standard input for this task.
public ByteSink
Gets the standard output for this task.
public SakerDirectory
Gets the build directory for the currently executing task or null if not available.
public SakerPath
Gets the path of the build directory for the associated task.
public TaskContext
Gets the task context which this utilities belong to.
public TaskDependencyFuture<?>
Gets a dependency future handle for the specified task.
public TaskFuture<?>
Gets a future handle for the specified task.
public TaskIdentifier
Gets the task identifier which was used to start this task.
public Object
Gets the task result for the given task identifier.
public TaskResultDependencyHandle
Gets a task result dependency handle for the given task identifier.
public TaskExecutionUtilities
Gets the utility class for this task context.
public SakerDirectory
Gets the working directory for the currently executing task.
public SakerPath
Gets the path of the working directory for the associated task.
public void
invalidate(Iterable<extends PathKey> pathkeys)
public void
Notifies the build system that a file at the given path was externally modified.
public ContentDescriptor
Notifies the build system that a file at the given path was externally modified and retrieves the content descriptor for the path.
public void
Invalidates the specified file and also associates the current posix file permissions of the file in the build system.
public Path
Mirrors a file with all children, recursively if the file is a directory.
public Path
Mirrors a file to the local file system.
public Path
Executes the mirroring for a directory at the given execution path.
public Path
Executes the mirroring for a file at the given execution path.
public MirroredFileContents
Executes the mirroring for a file at the given execution path and gets the file content descriptor.
public ByteSource
Opens a byte source to the contents of the file.
public InputStream
Opens an input stream to the contents of the file.
protected Object
Presents an opportunity to subclasses to override a given input file tag.
protected Object
Presents an opportunity to subclasses to override a given output file tag.
protected Object
Presents an opportunity to subclasses to override a given task output tag.
public void
Prints a line of string to the standard output of this task.
public void
Releases the previously acquired execution-wide lock for accessing the standard I/O.
public void
Stores a line of string to be replayed for the task if it is not re-run due to no incremental changes.
public <T> void
reportEnvironmentDependency(EnvironmentProperty<T> environmentproperty, T expectedvalue)
Reports an environment dependency for this task to the build runtime.
public <T> void
reportExecutionDependency(ExecutionProperty<T> executionproperty, T expectedvalue)
Reports an execution property dependency for this task to the build runtime.
public void
Reports an IDE configuration for this task.
public void
Reports an unhandled exception that occurred during the execution of the task for informational purposes.
public void
Reports an unhandled exception that occurred during the execution of the task for informational purposes.
public void
Reports a file addition dependency for this task to the build runtime.
public void
public void
public void
Reports an input file dependency for the path of the file and its contents.
public void
Reports a file input content dependency for this task to the build runtime.
public void
public void
public void
Reports an output file dependency for the path of the file and its contents.
public void
Reports a file output content dependency for this task to the build runtime.
public void
Sets the task output change detector for this task.
public SakerFile
Resolves a file or directory using the given absolute path.
public SakerFile
Same as resolveAtPath(SakerPath), but uses the specified base directory to resolve relative paths.
public SakerFile
Resolves a file or directory at the given path.
public SakerFile
Resolves a file or directory using the given relative path against a base directory.
public SakerFile
Resolves a file or directory with the given path names against a base directory.
public SakerDirectory
Resolves a directory using the given absolute path.
public SakerDirectory
Resolves a directory using the given absolute path, creating it if necessary, overwriting already existing files.
public SakerDirectory
Resolves a directory using the given absolute path, creating it if possible.
public SakerDirectory
Same as resolveDirectoryAtPath(SakerPath), but uses the specified base directory to resolve relative paths.
public SakerDirectory
Resolves a directory at a given path.
public SakerDirectory
Same as resolveDirectoryAtPathCreate(SakerPath), but uses the specified base directory to resolve relative paths.
public SakerDirectory
Resolves a directory at a given path, creating it if necessary, overwriting already existing files.
public SakerDirectory
Same as resolveDirectoryAtPathCreateIfAbsent(SakerPath), but uses the specified base directory to resolve relative paths.
public SakerDirectory
Resolves a directory at a given path, creating it if possible.
public SakerDirectory
Resolves a directory using the given relative path against a base directory.
public SakerDirectory
Resolves a directory using the given relative path against a base directory, creating it if necessary, overwriting already existing files.
public SakerDirectory
Resolves a directory using the given relative path against a base directory, creating it if possible.
public SakerDirectory
Resolves a directory with the given path names against a base directory.
public SakerDirectory
Resolves a directory with the given path names against a base directory, creating it if necessary, overwriting already existing files.
public SakerDirectory
Resolves a directory with the given path names against a base directory, creating it if possible.
public SakerFile
Resolves a file but not a directory using the given absolute path.
public SakerFile
Same as resolveFileAtPath(SakerPath), but uses the specified base directory to resolve relative paths.
public SakerFile
Resolves a file but not a directory at the given path.
public SakerFile
Resolves a file but not a directory using the given relative path against a base directory.
public SakerFile
Resolves a file but not a directory with the given path names against a base directory.
public void
Same as runTask(TaskIdentifier, TaskFactory<?>, TaskExecutionParameters) with the arguments derived from the specified launch arguments.
public void
runTask(TaskIdentifier taskid, TaskFactory<?> taskfactory)
Same as runTaskFuture(TaskIdentifier, TaskFactory<R>, TaskExecutionParameters) with null execution parameters, but returns void.
public void
runTask(TaskIdentifier taskid, TaskFactory<?> taskfactory, TaskExecutionParameters parameters)
public <R> TaskFuture<R>
Same as runTaskFuture(TaskIdentifier, TaskFactory<R>, TaskExecutionParameters) with the arguments derived from the specified launch arguments.
public <R> TaskFuture<R>
runTaskFuture(TaskIdentifier taskid, TaskFactory<R> taskfactory)
Convenience function to call runTaskFuture(TaskIdentifier, TaskFactory<R>, TaskExecutionParameters) with the default task execution parameters.
public <R> TaskFuture<R>
Starts a task and waits for its execution to complete.
public <R> R
Same as runTaskResult(TaskIdentifier, TaskFactory<R>, TaskExecutionParameters) with the arguments derived from the specified launch arguments.
public <R> R
runTaskResult(TaskIdentifier taskid, TaskFactory<R> taskfactory)
Convenience function to call runTaskResult(TaskIdentifier, TaskFactory<R>, TaskExecutionParameters) with the default task execution parameters.
public <R> R
Starts a task and waits for its execution to complete.
public void
setMetaData(String metadataid, Object value)
Sets an arbitrary meta-data as a result of this task.
public void
Sets the line display identifier for this task.
public void
Sets the output of the task for a given tag.
public <R> InnerTaskResults<R>
Starts an inner task to execute in the context of this task.
public void
public void
startTask(TaskIdentifier taskid, TaskFactory<?> taskfactory)
Convenience function to call TaskContext.startTask(TaskIdentifier, TaskFactory<R>, TaskExecutionParameters) with the default task execution parameters.
public <R> TaskFuture<R>
startTask(TaskIdentifier taskid, TaskFactory<R> taskfactory, TaskExecutionParameters parameters)
Starts a task for execution.
public <R> TaskFuture<R>
public <R> TaskFuture<R>
Convenience function to call TaskContext.startTask(TaskIdentifier, TaskFactory<R>, TaskExecutionParameters) with the default task execution parameters.
public void
Batch function for starting tasks specified by the launch arguments.
public void
startTasks(Map<extends TaskIdentifier, ? extends TaskFactory<?>> tasks)
Batch function for starting multiple tasks.
public void
startTasks(Map<extends TaskIdentifier, ? extends TaskFactory<?>> tasks, TaskExecutionParameters parameters)
Batch function for starting multiple tasks with the specified execution parameters.
public List<extends TaskFuture<?>>
Batch function for starting tasks with the specified launch arguments and retrieving the futures for them.
public ContentDescriptor
Executes synchronization of files from the given source path to the specified target path.
public NavigableMap<SakerPath, ContentDescriptor>
Converts the given files to a map with their retrieved paths as keys and content descriptors as values.
public NavigableMap<SakerPath, SakerFile>
toPathFileMap(Iterable<extends SakerFile> files)
Converts the given files to a map with their retrieved paths as keys.
public void
Writes the contents of the file to the specified output stream.
public void
Writes the contents of the file to the specified byte sink.
protected final TaskContext taskContext
The concrete TaskContext.
The concrete TaskExecutionUtilities.

The field just caches the value of TaskContext.getTaskUtilities() retrieved in the constructor.

Creates a new instance initialized with the task context which to forward the calls.
taskContextThe task context.
NullPointerExceptionIf the argument is null.
public void abortExecution(Throwable cause) throws NullPointerException
Overridden from: TaskContext
Signals an error during the execution of this task to the build runtime.

Calling this function will set a pending cause exception for the task result. Tasks which retrieve the result of this task will receive this exception.

The execution of this task will continue, and the task may still return an object from the Task.run(TaskContext) method. This task result will not be visible to other tasks, but this task can still retrieve it using TaskContext.getPreviousTaskOutput(Class<T>) when it is run next time.

For inner tasks, calling this function will return this exception via the InnerTaskResultHolder.getExceptionIfAny(), and the inner task may also return an object as a result, which is available via InnerTaskResultHolder.getResult().

Aborting excecution using this functions is preferable to throwing an exception directly when the task is able to handle previously thrown exceptions in the next run.

If the task uses this function to abort, then any results produced by the current run will be visible in the next one. The base for delta calculation will be the current run instead of the last previously successfully finished run.

It is useful to use this function when the task actually finishes its calculations successfully, but it is required to abort due to a semantic build error.

This method may be called multiple times. The first exception that is used to call this method will be the cause of the task execution exception, and any further exceptions will be added as suppressed exceptions.

causeThe abortion cause exception which should be reported.
NullPointerExceptionIf the cause is null.
Overridden from: TaskContext
Acquires the execution-wide lock for accessing the standard I/O.

Acquiring the lock will prevent any access to the standard I/O streams of the execution by other tasks. This means that the locker will have exclusive access to the input and output of the execution. Any output that is produced by concurrent tasks will be written out when this task releases the lock.

The lock is task execution based and not thread based. This means that the lock can be acquired on one thread and can be released on an other thread. Trying to acquire the lock multiple times will result in an exception.

It is recommended to acquire this lock when the task wants to display information that is necessary to be grouped together. Without locking, the lines printed to the output streams might be interlaced with the output of concurrent tasks.

It is required to acquire the lock to access the standard input. If the task wants to read input from the standard input stream and the lock is not acquired, then an exception will be thrown. This is to prevent misalignment of typed data from the user by concurrent output writing, and due to the fact that the standard input is one single shared stream of input for all concurrent tasks.

InterruptedExceptionIf the current thread is interrupted.
TaskStandardIOLockIllegalStateExceptionIf the lock was already acquired by this task.
Overridden from: TaskExecutionUtilities
Adds a file to the specified directory.

This method works the same way as SakerDirectory.add(SakerFile), but returns a reference to the argument file. It is mostly useful when designing tasks for remote execution, as the files need to be transferred to the coordinator machine, therefore the actually added file to the directory might be different than the file passed as parameter. See SakerDirectory.add(SakerFile) documentation for more info.

This method can be called from both remote and non-remote executed tasks.

directoryThe directory to add the file to.
fileThe file to add.
The file which was added to the directory. It is the same as the parameter if called from non-remote executed tasks.
NullPointerExceptionIf any of the parameters are null.
Overridden from: TaskExecutionUtilities
Add a file to the specified directory only if there is no file present yet with the same name.

This method works the same way as SakerDirectory.addIfAbsent(SakerFile), but returns the reference to the argument file. It is mostly useful when designing tasks for remote execution, as the files need to be transferred to the coordinator machine, therefore the actually added file to the directory might be different than the file passed as parameter. See SakerDirectory.addIfAbsent(SakerFile) documentation for more info.

This method can be called from both remote and non-remote executed tasks.

directoryThe directory to add the file to.
fileThe file to add.
The file which was added to the directory or null if there is already a file with the same name. If non-null, it is the same as the parameter if called from non-remote executed tasks.
NullPointerExceptionIf any of the parameters are null.
Overridden from: TaskExecutionUtilities
Add a file to the specified directory only if there is no directory present with the same name.

This method works the same way as SakerDirectory.addOverwriteIfNotDirectory(SakerFile), but returns the reference to the argument file. It is mostly useful when designing tasks for remote execution, as the files need to be transferred to the coordinator machine, therefore the actually added file to the directory might be different than the file passed as parameter. See SakerDirectory.addOverwriteIfNotDirectory(SakerFile) documentation for more info.

This method can be called from both remote and non-remote executed tasks.

directoryThe directory to add the file to.
fileThe file to add.
The file which was added to the directory or null if there is a directory present with the same name. If non-null, it is the same as the parameter if called from non-remote executed tasks.
NullPointerExceptionIf any of the parameters are null.
Overridden from: TaskExecutionUtilities
Add and synchronizes a SakerFile to the specified directory with the given name that has its contents backed by the given path key.

This method can be used to perform multiple operations in a single call. The method will invalidate the contents at the given path key and create a provider path file for the given path key. The created SakerFile is the added to the argument directory, and then syncronized.

Calling this method can be useful to batch the above operations in a single call. It is usually useful when you invoke an external process that produces a result file and want to add it to the build system file hierarchy.

directoryThe directory to add the file to.
pathkeyThe path key at which the given result file resides.
filenameThe name of the created SakerFile that is added to the directory.
IOExceptionIn case of I/O error.
NullPointerExceptionIf any of the arguments are null.
Overridden from: TaskExecutionUtilities
Collects the files for the given file collection strategy.

This method doesn't report the argument as dependency.

Important: Calling this method will trigger the computation of file deltas as it uses TaskContext.getPreviousFileAdditionDependency(FileCollectionStrategy) to avoid redundant computations.

This method is the same as:

 collectionstrategy.collectFiles(taskcontext);
 

When designing tasks for remote execution, it is recommended to call this method instead invoking FileCollectionStrategy.collectFiles(ExecutionDirectoryContext, TaskDirectoryContext) directly.

For correct incremental operation tasks should not forget to report the dependencies as well. Consider calling TaskExecutionUtilities.collectFilesReportInputFileAndAdditionDependency(Object, FileCollectionStrategy) instead of this function.

collectionstrategyThe file collection strategy.
The collected files.
NullPointerExceptionIf the argument is null.
Overridden from: TaskExecutionUtilities
Bulk method for calling TaskExecutionUtilities.collectFilesReportAdditionDependency(Object, FileCollectionStrategy).

This method collects the files for all the addition dependencies, and aggregates them into a single result map.

tagThe tag for the dependencies.
fileadditiondependenciesThe file addition dependencies.
The collected files.
NullPointerExceptionIf the file addition dependencies or any of the elements are null.
Overridden from: TaskExecutionUtilities
Collects the files for the given addition dependency, and reports it.

This method doesn't report input file dependency to the collected files.

Important: Calling this method will trigger the computation of file deltas as it uses TaskContext.getPreviousFileAdditionDependency(FileCollectionStrategy) to avoid redundant computations.

tagThe tag for the dependencies.
fileadditiondependencyThe file addition dependency.
The collected files.
NullPointerExceptionIf the file addition dependency is null.
Overridden from: TaskExecutionUtilities
Bulk method for calling TaskExecutionUtilities.collectFilesReportInputFileAndAdditionDependency(Object, FileCollectionStrategy).

This method collects the files for all the addition dependencies, and aggregates them into a single result map.

tagThe tag for the dependencies.
fileadditiondependenciesThe file addition dependencies.
The collected files.
NullPointerExceptionIf the file addition dependencies or any of the elements are null.
Overridden from: TaskExecutionUtilities
Collects the files for the given file addition dependency, and reports it and the files as dependencies.

This method collects the files for the specified addition dependency, reports the addition dependency, and reports the input dependencies for the collected files with their respective content descriptors.

Important: Calling this method will trigger the computation of file deltas as it uses TaskContext.getPreviousFileAdditionDependency(FileCollectionStrategy) to avoid redundant computations.

tagThe tag for the dependencies.
fileadditiondependencyThe file addition dependency.
The collected files.
NullPointerExceptionIf the file addition dependency is null.
Overridden from: TaskContext
Computes some data based on a contents of a file.

The execution context will ensure that a given data for a file and a computer is only computed once during an execution.

The computed datas will be cached during the execution. The cache uses the content descriptor, path of the file, and the computer as a key to the cached datas. Files which are not attached to any parents will not have their computed datas cached.

Multiple concurrent computation can run for a given file, but only one computation will run at the same time for file data computers that equal.

TThe computed data type.
fileThe file for data computation.
computerThe computer to use for deriving the data.
The computed data.
IOExceptionIn case of I/O error.
NullPointerExceptionIf any of the parameters are null or the computer computes null value.
RuntimeExceptionIf the data computer throws a runtime exception. The exception is directly relayed to the caller.
Overridden from: TaskExecutionUtilities
Creates a SakerFile instance which has its contents backed by the specified file system file at the given path.

This method can be used to include files from a given file system in the build. The resulting file needs to be added to a SakerDirectory to be included in the in-memory hierarchy.

If the file at the given path is a directory, a SakerDirectory instance will be returned that contains all the files which are present in the given directory. (The directory may be lazily populated.)

Note that we recommend using TaskExecutionUtilities.createProviderPathFile(String, ProviderHolderPathKey, ContentDescriptor) when when creating SakerFiles for externally modified files. You should specify your own content descriptor for the modified file as in case where the file modification times are used to detect file changes, some changes may be unnoticed on file systems that have larger granularity. (E.g. if the file modification times are stored as seconds.)

nameThe name to create the file with.
pathkeyThe path to the contents which is used by the created file.
The file or directory instance.
NullPointerExceptionIf any of the arguments are null.
IOExceptionIf accessing the file at the given path results in an I/O error.
Overridden from: TaskExecutionUtilities
Creates a SakerFile instance which has its contents backed by the specified file system file at the given path, and associates the argument content descriptor with the current contents.

The file represented with the given path must be a file, not a directory.

The argument content descriptor will be associated with the current contents of the file system at the given path. This means that unless some other agent modifies the contents at the given path, calling SakerFile.getContentDescriptor() will return the passed argument for the returned file.

This method can be used to include files from a given file system in the build. The resulting file needs to be added to a SakerDirectory to be included in the in-memory hierarchy.

nameThe name to create the file with.
pathkeyThe path to the contents which is used by the created file.
currentpathcontentdescriptorThe content descriptor to associate with the current file system contents.
The created file.
IOExceptionIf the operation fails due to I/O error.
NullPointerExceptionIf any of the arguments are null.
InvalidFileTypeExceptionIf the file is a directory.
Overridden from: TaskExecutionUtilities
Creates a SakerFile instance which has its contents backed by the specified file system file at the given path.

The name of the file is the same as the name of the argument path.

This method is the same as:

 createProviderPathFile(pathkey.getPath().getFileName(), pathkey)
 
pathkeyThe path key.
The file or directory instance.
NullPointerExceptionIf the argument is null.
IOExceptionIf accessing the file at the given path results in an I/O error.
saker.build 0.8.13
Overridden from: TaskExecutionUtilities
Creates a SakerFile instance which has its contents backed by the specified file system file at the given path, and associates the argument content descriptor and posix file permissions with the current contents.

The method works the same way as TaskExecutionUtilities.createProviderPathFile(String, ProviderHolderPathKey, ContentDescriptor), but also associated the specified posix file permissions with the file.

The result file will return the argument posix file permissions from its SakerFile.getPosixFilePermissions() method.

It is not required for the underlying filesystem to support posix file permissions.

Note that the argument content descriptor should reflect the specified posix file permissions as well. It is recommended to use PosixFilePermissionsDelegateContentDescriptor.

nameThe name to create the file with.
pathkeyThe path to the contents which is used by the created file.
currentpathcontentdescriptorThe content descriptor to associate with the current file system contents.
permissionsThe posix file permissions to associate with the given file. May be null.
The created file.
IOExceptionIf the operation fails due to I/O error.
NullPointerExceptionIf any of the arguments except the posix file permissions are null.
InvalidFileTypeExceptionIf the file is a directory.
saker.build 0.8.13
Overridden from: TaskExecutionUtilities
Gets the raw contents of the file as a byte array.

Calling this method might implicitly synchronize the file to its real location, or to some other cache location when remote execution is used.

fileThe file.
The raw contents of the file.
IOExceptionIn case of I/O error.
NullPointerExceptionIf the file is null.
Overridden from: TaskExecutionUtilities
Gets the content descriptors of the children of the specified directory.

The resulting map is mapped by the file names of the children.

dirThe directory.
A new map of file names mapped to their content descriptors.
NullPointerExceptionIf the directory is null.
Overridden from: TaskExecutionUtilities
Gets the contents of the file as a String.

Calling this method might implicitly synchronize the file to its real location, or to some other cache location when remote execution is used.

fileThe file.
The string contents of the file.
IOExceptionIn case of I/O error.
NullPointerExceptionIf the file is null.
Overridden from: TaskContext
Gets the execution context which is used to run this task.
The execution context.
Overridden from: TaskContext
Gets a file delta collection for all possible file delta types.

The returned container will include all file deltas regardless of DeltaType.

Important: Calling this method will trigger the computation of file deltas. Any input dependency tasks should be waited for before calling this method. By waiting for tasks after file delta computation, you risk the file deltas being incorrectly reported which can result in incorrect incremental builds. See TaskContext documentation for more info.

The complete file delta collection.
Overridden from: TaskContext
Gets a file delta collection for the given delta type.

The resulting container will only include deltas which type matches the given parameter.

If the parameter is not a file change related DeltaType then an empty container will be returned.

Important: Calling this method will trigger the computation of file deltas. Any input dependency tasks should be waited for before calling this method. By waiting for tasks after file delta computation, you risk the file deltas being incorrectly reported which can result in incorrect incremental builds. See TaskContext documentation for more info.

deltatypeThe delta type to match.
The file delta container for the given delta type.
NullPointerExceptionIf the delta type is null.
public Set<extends BuildDelta> getNonFileDeltas()
Overridden from: TaskContext
Gets the set of deltas which contain no file deltas.
An unmodifiable set of non-file deltas.
Overridden from: TaskContext
Gets the current state of collected files for a previously reported file addition dependency.

The resulting map will have the same entries as if the dependency was used to collect the files themselves. The resulting map was used to compute the deltas for the task.

Calling this method instead of collecting the files manually can result in performance increase as it can avoid duplicate computations.

If the file addition dependency was not reported in the previous run, null will be returned.

Important: Calling this method will trigger the computation of file deltas. Any input dependency tasks should be waited for before calling this method. By waiting for tasks after file delta computation, you risk the file deltas being incorrectly reported which can result in incorrect incremental builds. See TaskContext documentation for more info.

dependencyThe previously reported file addition dependency.
An unmodifiable map of files which were collected based on the parameter dependency or null if the dependency was not reported previously.
NullPointerExceptionIf the dependency is null.
Overridden from: TaskContext
Gets the current state of previously reported file input dependencies for a given tag.

The resulting map will have one entry for every input file reported previously. The resulting map contains the files which were used to compute deltas for the task.

It is recommended to get the files using this method if there are no deltas for the given tag, as it can avoid unnecessary computations by the task.

Important: Calling this method will trigger the computation of file deltas. Any input dependency tasks should be waited for before calling this method. By waiting for tasks after file delta computation, you risk the file deltas being incorrectly reported which can result in incorrect incremental builds. See TaskContext documentation for more info.

tagAn arbitrary nullable tag. See TaskContext documentation for more info.
An unmodifiable map of files which were reported as inputs. null values mean the file doesn't exist at a given path.
Overridden from: TaskContext
Gets the current state of previously reported file output dependencies for a given tag.

The resulting map will have one entry for every output file reported previously. The resulting map contains the files which were used to compute deltas for the task.

Important: Calling this method will trigger the computation of file deltas. Any input dependency tasks should be waited for before calling this method. By waiting for tasks after file delta computation, you risk the file deltas being incorrectly reported which can result in incorrect incremental builds. See TaskContext documentation for more info.

tagAn arbitrary nullable tag. See TaskContext documentation for more info.
An unmodifiable map of files which were reported as outputs. null values mean the file doesn't exist at a given path.
public <T> T getPreviousTaskOutput(Class<T> type) throws NullPointerException
Overridden from: TaskContext
Gets the output of the task from the previous run.
TThe expected type of the previous output.
typeThe type to check if the previous output is an instance of.
The result of the previous run. null if the task was not run before this execution, it returned null, or it is not an instance of the specified type.
NullPointerExceptionIf tag or type is null.
public <T> T getPreviousTaskOutput(Object tag, Class<T> type) throws NullPointerException
Overridden from: TaskContext
Gets the previously set task output for the given tag.
TThe expected type of the value.
tagThe tag to retrieve the associated value for.
typeThe type to check if the associated value is an instance of.
The value which was associated to the specified tag. null if the task was not run before this execution, the value was not found, or it is not an instance of the specified type.
NullPointerExceptionIf tag or type is null.
Overridden from: TaskContext
Gets the progress monitor for this task.

The progress monitor can be used to check if the execution has been cancelled externally.

The progress monitor. (Never null.)
Overridden from: TaskExecutionUtilities
Gets the current value of the specified environment property and reports it as a dependency.
TThe type of the returned property.
propertyThe environment property.
The current value of the environment property.
NullPointerExceptionIf the property is null.
PropertyComputationFailedExceptionIf the argument property throws an exception during the computation of its value. The thrown exception is available through the cause.
Overridden from: TaskExecutionUtilities
Gets the current value of the specified execution property and reports it as a dependency.
TThe type of the returned property.
propertyThe execution property.
The current value of the execution property.
NullPointerExceptionIf the property is null.
PropertyComputationFailedExceptionIf the argument property throws an exception during the computation of its value. The thrown exception is available through the cause.
Overridden from: TaskContext
Gets the input reader that can be used to read secret input from the user.

The returned reader can be used to prompt the user to enter data in a secret way. This usually means that the characters the user enters will not be directly displayed on the computer screen, but will be hidden. (E.g. the console doesn't echo back the characters, or using a password text box.)

Reading functions on the returned result may lock the standard IO lock before reading the secret input, but may not based on the implementation.

Callers must handle the case if the secret reader is not available. This usually means that the build execution was configured in a way that direct input reading is not possible. (E.g. during a CI (continuous integration) build.)

The secret input reader or null if not available.
Overridden from: TaskContext
Gets the standard error for this task.

The standard error is private to the currently executed task. It is buffered, but unlike the standard out, will not be flushed during the execution of the task, only after it has finished. It will be flushed as a block of bytes and will not be interlaced with concurrently executing tasks.

The display identifier is not prepended to the lines of this output. The contents written to standard err will not be replayed when the task is not rerun due to no deltas.

The returned sink is not thread-safe, the caller must ensure proper synchronization, otherwise bytes written to the sink may be lost, or scrambled.

The standard error for this task.
Overridden from: TaskContext
Gets the standard input for this task.

The standard input is shared by all concurrently running tasks in the same build environment. The current task must lock on the standard I/O lock via TaskContext.acquireStandardIOLock() before calling any reading functions on the returned stream. Not locking will result in a TaskStandardIOLockIllegalStateException when calling reading functions.

The standard input and output can be both used when the lock is acquired to provide an interactive interface to the user.

The standard input for the build execution.
Overridden from: TaskContext
Gets the standard output for this task.

The standard output is private to the currently executed task. It is buffered, and is flushed when the execution sees it as a best opportunity. The buffering occurs on a per-line basis, no partially finished lines will be printed, unless the execution-wide standard I/O lock is acquired.

The bytes written to this stream is examined and every line is prepended with the currently set display identifier. (See TaskContext.setStandardOutDisplayIdentifier(String))

The bytes written to this stream is not replayed to the user if the task is not rerun due to no deltas. To print information which are replayed use TaskContext.println(String).

When buffered lines are flushed from this stream they might be interlaced with output lines of concurrently executing tasks. They might be interlaced, but they will not be mangled.

The standard output for this task.
Overridden from: TaskDirectoryContext
Gets the build directory for the currently executing task or null if not available.

The build directory is based on the execution-wide base build directory and the task execution parameters specified for the task.

It is strongly recommended that unless explicitly specified by the user, all tasks produce outputs under the directory returned by this method.

To avoid checking null result of this method consider using SakerPathFiles.requireBuildDirectory(TaskDirectoryContext) which throws an appropriate exception if it is not available.

The build directory or null if not available.
Overridden from: TaskDirectoryPathContext
Gets the path of the build directory for the associated task.

The returned path is the absolute execution path to the build directory of the task. This is affected by the task execution parameters. The result may be null, if there's no build directory configured for the task or build execution.

The path is the same as TaskDirectoryContext.getTaskBuildDirectory().getSakerPath() would return.

The absolute path of the build directory or null if none.
Overridden from: TaskExecutionUtilities
Gets the task context which this utilities belong to.
The task context.
Overridden from: TaskContext
Gets a dependency future handle for the specified task.

The task is not required to be started, or exist in the build runtime as of the calling of this function. Futures can be obtained to not yet started tasks as well.

Same as:

 getTaskFuture(taskid).getAsDependencyFuture();
 
taskidThe task identifier.
The dependency future handle for the task.
NullPointerExceptionIf the task identifier is null.
Overridden from: TaskContext
Gets a future handle for the specified task.

The task is not required to be started, or exist in the build runtime as of the calling of this function. Futures can be obtained to not yet started tasks as well.

taskidThe task identifier.
The future handle for the task.
NullPointerExceptionIf the task identifier is null.
Overridden from: TaskContext
Gets the task identifier which was used to start this task.
The task identifier of this task.
Overridden from: TaskContext
Gets the task result for the given task identifier.

This method waits for the specified task if needed, and works the same way as TaskFuture.get().

If this method throws a TaskExecutionFailedException, it is considered to be a valid return scenario. A dependency on the the associated task will be installed as if a return value was returned.

Callers should handle the possiblity of tasks returning StructuredTaskResult instances.

taskidThe task identifier to retrieve the results for.
The result of the task execution. Only null if the task returned null as a result.
TaskExecutionExceptionIn case of any exceptions related to the task execution.
NullPointerExceptionif the task identifier is null.
Overridden from: TaskResultResolver
Gets a task result dependency handle for the given task identifier.

The retrieval of the handle is implementation dependent. The TaskResultDependencyHandle.get() method may return structured task results.

taskidThe task identifier
The result dependency handle for the given task identifier.
NullPointerExceptionIf the argument is null.
IllegalArgumentExceptionOptional exception, if a task result was not found for the given identifier.
Overridden from: TaskContext
Gets the utility class for this task context.

The utility instance provides bulk operations, utility functions, and extensions for working with task context.

Usage of this is especially recommended when designing remote executable tasks.

The task utilities exist for the purpose of keeping the TaskContext interface clean and functions which could bloat the interface are implemented in the utilities instance.

The utility instance.
Overridden from: TaskDirectoryContext
Gets the working directory for the currently executing task.

The working directory is based on the execution-wide base working directory and the task execution parameters specified for the task.

Any relative paths used by this task should be resolved against this directory.

Note: In some cases this method may return null. This might be for example when the build system is detecting the deltas for a given task, and the working directory path did not resolve to an actual path. Callers in FileCollectionStrategy.collectFiles(ExecutionDirectoryContext, TaskDirectoryContext) should handle the possibility of this method returning null. If this method is called during task execution (I.e. inside Task.run(TaskContext), then this method will never return null.)

The working directory.
Overridden from: TaskDirectoryPathContext
Gets the path of the working directory for the associated task.

The returned path is the absolute execution path to the working directory of the task. This is affected by the task execution parameters.

The path is the same as TaskDirectoryContext.getTaskWorkingDirectory().getSakerPath() would return.

It can be used to resolve relative user arguments against it without actually querying the SakerDirectory instance.

The absolute path of the working directory.
public void invalidate(Iterable<extends PathKey> pathkeys) throws NullPointerException
Overridden from: TaskExecutionUtilities
pathkeysThe path keys to invalidate.
NullPointerExceptionIf the argument, or any of its element is null.
public void invalidate(PathKey pathkey) throws NullPointerException
Overridden from: TaskContext
Notifies the build system that a file at the given path was externally modified.

This method needs to be called when tasks decides to externally modify files which are referenced by the build system.
External modifications include:

  • Modifying a file using an external process. (E.g. spawning an external compiler process)
  • Using direct Java I/O APIs to modify files. E.g. File, Path and related classes.
  • Directly modifying files using file providers.
  • Other file modifications that aren't done through the SakerFile API.
This method is required to be called so synchronization of the in-memory file hierarchy can work correctly.

If task implementations forget to call this method, the synchronization of the files might not work as expected. Synchronizations might be skipped, while the file contents won't be the same as expected.

Generally if task implementations do not overwrite files multiple times, and keep intermediate files separate, they don't need to expect failures. Tasks should aim to mainly use the SakerFile API or if they really need to, only work with the local file system.

If task implementations only use SakerFile.synchronize() and related functions, they don't need to call this.

Calling this method will not modify the SakerFile in-memory hierarchy in any way.

Internal implementation note: This function invalidates the specified handle for the content database. As the content database can cache file disk contents, this method needs to be called so the cached data is invalidated. If this method is not called, then the content database might not re-check the disk contents before synchronization. In that case the synchronization will be skipped, even though it should happen.

When remote execution (via clusters) are used, this method will invalidate the local cache content database and the main content database as well. In some cases it can happen that the content database on the actual file system where the file resides will not be invalidated. This can happen when a task on cluster A modifies a file on cluster B. It is a very insignificant edge-case and it it strongly discouraged to configure an execution where such a scenario can happen.

pathkeyThe path key to the file.
NullPointerExceptionIf the path key is null.
Overridden from: TaskContext
Notifies the build system that a file at the given path was externally modified and retrieves the content descriptor for the path.

This method works the same way as TaskContext.invalidate(PathKey), but reads the content descriptor at the given path after the invalidation.

pathkeyThe path key to the file.
The current content descriptor for the path, or null if the file doesn't exist.
NullPointerExceptionIf the path key is null.
Overridden from: TaskExecutionUtilities
Invalidates the specified file and also associates the current posix file permissions of the file in the build system.

The method works like TaskContext.invalidate(PathKey), but also instructs the build system to track the posix file permissions of the specified file. This will cause the file returned from TaskExecutionUtilities.createProviderPathFile(String, ProviderHolderPathKey) to have its SakerFile.getPosixFilePermissions() filled.

This method works only if the argument file resides on a filesystem that supports posix file permissions. Otherwise this method works the same way as TaskContext.invalidate(PathKey) without taking posix file permissions into account.

pathkeyThe path key to invalidate.
NullPointerExceptionIf the path key is null.
IOExceptionIn case of I/O error.
saker.build 0.8.13
Overridden from: TaskContext
Mirrors a file with all children, recursively if the file is a directory.

Same as calling:

 mirror(file, DirectoryVisitPredicate.everything());
 
fileThe file to mirror.
The path to the mirrored file.
IOExceptionIn case of I/O error.
NullPointerExceptionIf file is null.
FileMirroringUnavailableExceptionIf file mirroring is not available for this file.
Overridden from: TaskContext
Mirrors a file to the local file system.

If the file is a directory, then the parameter predicate will be used to select the files to mirror.

See TaskContext documentation for more information about mirroring.

fileThe file to miror.
synchpredicateThe predicate to use for mirroring. If this is null, DirectoryVisitPredicate.everything() will be used.
The path to the mirrored file.
IOExceptionIn case of I/O error.
NullPointerExceptionIf file is null.
FileMirroringUnavailableExceptionIf file mirroring is not available for this file.
Overridden from: TaskExecutionUtilities
Executes the mirroring for a directory at the given execution path.

The method will resolve the specified path to a directory and execute the mirroring.

If the file doesn't exist, or not a directory, an exception is thrown.

pathThe path of the directory to mirror. Relative paths are resolved against the task working directory.
synchpredicateThe predicate to use for mirroring. If this is null, DirectoryVisitPredicate.everything() will be used.
The path to the mirrored directory.
IOExceptionIn case of I/O error.
Overridden from: TaskExecutionUtilities
Executes the mirroring for a file at the given execution path.

The method will resolve the specified path to a file and execute the mirroring.

If the file doesn't exist, or is a directory, an exception is thrown.

pathThe path of the file to mirror. Relative paths are resolved against the task working directory.
The path to the mirrored file.
IOExceptionIn case of I/O error.
InvalidFileTypeExceptionIf the file at the path is a directory.
FileNotFoundExceptionIf no file found at the given path.
NullPointerExceptionIf the path is null.
Overridden from: TaskExecutionUtilities
Executes the mirroring for a file at the given execution path and gets the file content descriptor.

The method works the same way as TaskExecutionUtilities.mirrorFileAtPath(SakerPath), but returns the content descriptor of the mirrored file.

pathThe path of the file to mirror. Relative paths are resolved against the task working directory.
The path and contents of the mirrored file.
IOExceptionIn case of I/O error.
InvalidFileTypeExceptionIf the file at the path is a directory.
FileNotFoundExceptionIf no file found at the given path.
NullPointerExceptionIf the path is null.
Overridden from: TaskExecutionUtilities
Opens a byte source to the contents of the file.

Calling this method might implicitly synchronize the file to its real location, or to some other cache location when remote execution is used.

fileThe file.
The opened byte source.
IOExceptionIn case of I/O error.
NullPointerExceptionIf the file is null.
Overridden from: TaskExecutionUtilities
Opens an input stream to the contents of the file.

Calling this method might implicitly synchronize the file to its real location, or to some other cache location when remote execution is used.

fileThe file.
The opened input stream.
IOExceptionIn case of I/O error.
NullPointerExceptionIf the file is null.
Presents an opportunity to subclasses to override a given input file tag.

This method is called for each file tag that is passed to any of the file dependency management methods.

The default implementation directly returns the argument.

tagThe tag. May be null.
The new tag to replace the argument with.
Presents an opportunity to subclasses to override a given output file tag.

This method is called for each file tag that is passed to any of the file dependency management methods.

The default implementation directly returns the argument.

tagThe tag. May be null.
The new tag to replace the argument with.
Presents an opportunity to subclasses to override a given task output tag.

This method is called for each task output tag that is passed to any of the task output management methods.

The default implementation directly returns the argument.

tagThe tag. May be null.
The new tag to replace the argument with.
public void println(String line)
Overridden from: TaskContext
Prints a line of string to the standard output of this task.

The lines printed using this function will be replayed if the task is not executed again due to no incremental changes.

The line is automatically prepended by the display identifier if set.

To display uniformly formatted data, we recommend using SakerLog logging functions.

The argument line will be automatically appended with a line ending character(s).

lineThe line to print.
Overridden from: TaskContext
Releases the previously acquired execution-wide lock for accessing the standard I/O.

When the lock is released all partially finished lines of TaskContext.getStandardOut() will be ended.

TaskStandardIOLockIllegalStateExceptionIf the lock was not acquired.
public void replayPrintln(String line) throws NullPointerException
Overridden from: TaskContext
Stores a line of string to be replayed for the task if it is not re-run due to no incremental changes.

This method works the same way as TaskContext.println(String), however, it doesn't actually print the line to the output. It only stores the line to be printed if the task is not executed again due to no incremental changes.

lineThe line to print.
NullPointerExceptionIf the line is null
public <T> void reportEnvironmentDependency(EnvironmentProperty<T> environmentproperty, T expectedvalue) throws NullPointerException, IllegalTaskOperationException
Overridden from: TaskContext
Reports an environment dependency for this task to the build runtime.

This method records the dependency value for the given property for the execution runtime. When the task is executed next time in an incremental manner, the current value for the property will be compared to the expected value. If it changed, an appropriate delta will be triggered and the task will be rerun.

TThe type of the property
environmentpropertyThe environment property.
expectedvalueThe expected value of the property.
NullPointerExceptionIf the property is null.
IllegalTaskOperationExceptionIf the property dependency was reported multiple times and they do not equal.
public <T> void reportExecutionDependency(ExecutionProperty<T> executionproperty, T expectedvalue) throws NullPointerException, IllegalTaskOperationException
Overridden from: TaskContext
Reports an execution property dependency for this task to the build runtime.

This method records the dependency value for the given property for the execution runtime. When the task is executed next time in an incremental manner, the current value for the property will be compared to the expected value. If it changed, an appropriate delta will be triggered and the task will be rerun.

TThe type of the property
executionpropertyThe execution property.
expectedvalueThe expected value of the property.
NullPointerExceptionIf the property is null.
IllegalTaskOperationExceptionIf the property dependency was reported multiple times and they do not equal.
Overridden from: TaskContext
Reports an IDE configuration for this task.

IDE configurations can be considered as meta-data from the tasks which can be used to properly configure an editor for IDE related features.

Tasks are not required to always report IDE configurations, it can be toggled by the user using execution parameters. If a task decides to adhere these configuration changes, make sure to report an execution dependency, so the task is rerun when the parameter changes. (See IDEConfigurationRequiredExecutionProperty)

configurationThe IDE configuration.
NullPointerExceptionIf the configuration is null.
Overridden from: TaskExecutionUtilities
Reports an unhandled exception that occurred during the execution of the task for informational purposes.

This method works the same way as TaskContext.reportIgnoredException(ExceptionView), but takes care of converting the exception to an appropriate ExceptionView.

eThe exception.
Overridden from: TaskContext
Reports an unhandled exception that occurred during the execution of the task for informational purposes.

Unhandled exceptions do not modify the operation of the task or the build execution. The build system may present these to the user to debug or analyze possible inconsistent build output.

Ignoring an exception should not modify the output of a task in any way.

One good example for an ignored exception is one thrown during verbose logging to the standard output. When the task tries to write some verbose information about the execution output, but it fails with an exception, then the task might choose to ignore the thrown exception, as it doesn't modify the result of the task in any way, but only the displayed information to the user.

The build system may handle the ignored exceptions in an implementation dependent way.

If the parameter is null, a NullPointerException will be ignored.

eThe exception.
Overridden from: TaskContext
Reports a file addition dependency for this task to the build runtime.

The build executor will collect the files for the dependency next time the task is incrementally run. If it detects any added files, then an appropriate delta will be triggered, and the task will be rerun.

Important: The task needs to report any used files as input dependencies via TaskContext.reportInputFileDependency(Object, SakerPath, ContentDescriptor), else a delta will be triggered for the unreported files as well next time the task is run.

Example:
The task reports a file addition dependency, and reports the file A as input.
The user adds file B as a new file. Next time the task is incrementally run, the build executor collects the files, and will report file B as an addition with the appropriate delta and rerun the task.
If the task didn't report file A, then the build executor would report file A as an addition, even though it is not newly added. It is important to report the files the task uses as input dependency.

A file addition dependency can be reported multiple times, with different tags as well.

tagAn arbitrary nullable tag. See TaskContext documentation for more info.
dependencyThe dependency to report.
NullPointerExceptionIf dependency is null.
Overridden from: TaskExecutionUtilities
tagThe tag for the dependency.
filesThe files to report the dependencies for.
InvalidPathFormatExceptionIf the path of a file is not absolute.
NullPointerExceptionIf the files or any of its elements are null.
Overridden from: TaskExecutionUtilities
Bulk method for TaskContext.reportInputFileDependency(Object, SakerPath, ContentDescriptor).

Each path-content descriptor pair will be reported as an input dependency.

tagThe tag for the dependency.
pathcontentsThe paths to contents map for each dependency.
NullPointerExceptionIf the path contents are null.
IllegalArgumentExceptionIf the map is not sorted by natural order.
Overridden from: TaskExecutionUtilities
Reports an input file dependency for the path of the file and its contents.

See TaskContext.reportInputFileDependency(Object, SakerPath, ContentDescriptor).

tagThe tag for the dependency.
fileThe file to report the dependency for.
InvalidPathFormatExceptionIf the path of the file is not absolute.
NullPointerExceptionIf the file is null.
public void reportInputFileDependency(Object tag, SakerPath path, ContentDescriptor expectedcontent) throws NullPointerException
Overridden from: TaskContext
Reports a file input content dependency for this task to the build runtime.

The build executor will check if the contents of the file at the given path have changed next time the task is incrementally run. If it detects changes, then an appropriate delta will be triggered, and the task will be rerun.

When an input dependency is reported multiple times with the same path and tag, then the actually recorded contents is chosen in an implementation dependent manner, and no exception is thrown.

See TaskContext.getTaskUtilities() for reporting bulk file dependencies, or working with file instances directly.

tagAn arbitrary nullable tag. See TaskContext documentation for more info.
pathThe path of the file. If relative, it will be resolved against the current task working directory.
expectedcontentThe expected content of the file. null is treated as if the file is expected to not exist.
NullPointerExceptionIf path is null.
Overridden from: TaskExecutionUtilities
tagThe tag for the dependency.
filesThe files to report the dependencies for.
InvalidPathFormatExceptionIf the path of a file is not absolute.
NullPointerExceptionIf the files or any of its elements are null.
Overridden from: TaskExecutionUtilities
Bulk method for TaskContext.reportOutputFileDependency(Object, SakerPath, ContentDescriptor).

Each path-content descriptor pair will be reported as an output dependency.

tagThe tag for the dependency.
pathcontentsThe paths to contents map for each dependency.
NullPointerExceptionIf the path contents are null.
IllegalArgumentExceptionIf the map is not sorted by natural order.
Overridden from: TaskExecutionUtilities
Reports an output file dependency for the path of the file and its contents.

See TaskContext.reportOutputFileDependency(Object, SakerPath, ContentDescriptor).

tagThe tag for the dependency.
fileThe file to report the dependency for.
InvalidPathFormatExceptionIf the path of the file is not absolute.
NullPointerExceptionIf the file is null.
public void reportOutputFileDependency(Object tag, SakerPath path, ContentDescriptor expectedcontent) throws NullPointerException
Overridden from: TaskContext
Reports a file output content dependency for this task to the build runtime.

The build executor will check if the contents of the file at the given path have changed next time the task is incrementally run. If it detects changes, then an appropriate delta will be triggered, and the task wil be rerun.

When an output dependency is reported multiple times with the same path and tag, then the actually recorded contents is chosen in an implementation dependent manner, and no exception is thrown

It is recommended that all output files are under the build directory, unless explicitly specified by the user.

The reported output files are not automatically synchronized by the build runtime. (See SakerFile.synchronize())

See TaskContext.getTaskUtilities() for reporting bulk file dependencies, or working with file instances directly.

tagAn arbitrary nullable tag. See TaskContext documentation for more info.
pathThe path of the file. If relative, it will be resolved against the current task working directory.
expectedcontentThe expected content of the file. null is treated as if the file is expected to not exist.
NullPointerExceptionIf path is null.
Overridden from: TaskContext
Sets the task output change detector for this task.

Setting an output change detector for the self task can result in skipping rerunning the tasks which depend on this task. The set detector should report the output unchanged if the object returned from Task.run(TaskContext) can be considered as unchanged from an external perspective.

The task can report themselves as unchanged, if output files of the task changed, but the information held in the output object remained the same. Usually EqualityTaskOutputChangeDetector is used with this method instantiated with the returned output object.

A very simple example for this:
A task calculates the sum of two input integers. In the first run it calculates 1 + 3. The input integers change for the next build, and the task will now calculate 2 + 2.
As the outputs of the task is the same, setting a self change detector can result in not rerunning any other tasks which depend on this.

changedetectorThe output change detector to set.
IllegalTaskOperationExceptionIf the change detector was already set for this task. (This method can be called only once.)
NullPointerExceptionIf the change detector is null.
Overridden from: TaskExecutionUtilities
Same as TaskExecutionUtilities.resolveAtPath(SakerPath), but uses the specified base directory to resolve relative paths.
basedirThe base directory.
pathThe path to resolve.
The found file at the given path or null if not found.
NullPointerExceptionIf path is null, or path is relative and base directory is null.
Overridden from: TaskExecutionUtilities
Resolves a file or directory at the given path.

If the path is relative, it will be resolved against the current task working directory.

If it is absolute, the execution root directories will be used as a base of resolution.

pathThe path to resolve.
The found file at the given path or null if not found.
NullPointerExceptionIf the path is null.
Overridden from: TaskExecutionUtilities
Resolves a file or directory using the given relative path against a base directory.
basedirThe base directory.
pathThe relative path.
The resolved file or null if not found.
NullPointerExceptionIf any of the arguments are null.
InvalidPathFormatExceptionIf the path is not relative.
Overridden from: TaskExecutionUtilities
Resolves a file or directory with the given path names against a base directory.

The path names are interpreted as if they were relative compared to the base directory.

basedirThe base directory.
namesThe relative path names.
The resolved file or null if not found.
NullPointerExceptionIf any of the arguments or path names are null.
InvalidPathFormatExceptionIf any of the path name has invalid format.
Overridden from: TaskExecutionUtilities
Resolves a directory using the given absolute path.
pathThe absolute path.
The resolved directory or null if a directory was not found at the path.
NullPointerExceptionIf the path is null.
InvalidPathFormatExceptionIf the path is not absolute.
Overridden from: TaskExecutionUtilities
Resolves a directory using the given absolute path, creating it if necessary, overwriting already existing files.
pathThe absolute path.
The directory at the given path.
NullPointerExceptionIf the path is null.
InvalidPathFormatExceptionIf the path is not absolute.
Overridden from: TaskExecutionUtilities
Resolves a directory using the given absolute path, creating it if possible.

This method doesn't overwrite the already existing file at the path if it's not a directory.

pathThe absolute path.
The directory at the given path or null if it cannot be created.
NullPointerExceptionIf the path is null.
InvalidPathFormatExceptionIf the path is not absolute.
Overridden from: TaskExecutionUtilities
Same as TaskExecutionUtilities.resolveDirectoryAtPath(SakerPath), but uses the specified base directory to resolve relative paths.
basedirThe base directory.
pathThe path to resolve.
The found directory at the given path or null if a directory was not found at the path.
NullPointerExceptionIf path is null, or path is relative and base directory is null.
Overridden from: TaskExecutionUtilities
Resolves a directory at a given path.

If the path is relative, it will be resolved against the current task working directory.

If it is absolute, the execution root directories will be used as a base of resolution.

pathThe path to resolve.
The found directory at the given path or null if a directory was not found at the path.
NullPointerExceptionIf the path is null.
Overridden from: TaskExecutionUtilities
Same as TaskExecutionUtilities.resolveDirectoryAtPathCreate(SakerPath), but uses the specified base directory to resolve relative paths.
basedirThe base directory.
pathThe path to resolve.
The directory at the given path.
NullPointerExceptionIf path is null, or path is relative and base directory is null.
Overridden from: TaskExecutionUtilities
Resolves a directory at a given path, creating it if necessary, overwriting already existing files.

If the path is relative, it will be resolved against the current task working directory.

If it is absolute, the execution root directories will be used as a base of resolution.

pathThe path to resolve.
The directory at the given path.
NullPointerExceptionIf the path is null.
Overridden from: TaskExecutionUtilities
Same as TaskExecutionUtilities.resolveDirectoryAtPathCreateIfAbsent(SakerPath), but uses the specified base directory to resolve relative paths.
basedirThe base directory.
pathThe path to resolve.
The directory at the given path or null if it cannot be created.
NullPointerExceptionIf path is null, or path is relative and base directory is null.
Overridden from: TaskExecutionUtilities
Resolves a directory at a given path, creating it if possible.

This method doesn't overwrite the already existing file at the path if it's not a directory.

If the path is relative, it will be resolved against the current task working directory.

If it is absolute, the execution root directories will be used as a base of resolution.

pathThe path to resolve.
The directory at the given path or null if it cannot be created.
NullPointerExceptionIf the path is null.
Overridden from: TaskExecutionUtilities
Resolves a directory using the given relative path against a base directory.
basedirThe base directory.
pathThe relative path.
The resolved directory or null if a directory was not found at the path.
NullPointerExceptionIf any of the arguments are null.
InvalidPathFormatExceptionIf the path is not relative.
Overridden from: TaskExecutionUtilities
Resolves a directory using the given relative path against a base directory, creating it if necessary, overwriting already existing files.
basedirThe base directory.
pathThe relative path.
The directory at the given path.
NullPointerExceptionIf any of the arguments are null.
InvalidPathFormatExceptionIf the path is not relative.
Overridden from: TaskExecutionUtilities
Resolves a directory using the given relative path against a base directory, creating it if possible.

This method doesn't overwrite the already existing file at the path if it's not a directory.

basedirThe base directory.
pathThe relative path.
The directory at the given path or null if it cannot be created.
NullPointerExceptionIf any of the arguments are null.
InvalidPathFormatExceptionIf the path is not relative.
Overridden from: TaskExecutionUtilities
Resolves a directory with the given path names against a base directory.

The path names are interpreted as if they were relative compared to the base directory.

basedirThe base directory.
namesThe relative path names.
The resolved directory or null if a directory was not found at the path.
NullPointerExceptionIf any of the arguments or path names are null.
InvalidPathFormatExceptionIf any of the path name has invalid format.
Overridden from: TaskExecutionUtilities
Resolves a directory with the given path names against a base directory, creating it if necessary, overwriting already existing files.

The path names are interpreted as if they were relative compared to the base directory.

basedirThe base directory.
namesThe relative path names.
The directory at the given path.
NullPointerExceptionIf any of the arguments or path names are null.
InvalidPathFormatExceptionIf any of the path name has invalid format.
Overridden from: TaskExecutionUtilities
Resolves a directory with the given path names against a base directory, creating it if possible.

This method doesn't overwrite the already existing file at the path if it's not a directory.

The path names are interpreted as if they were relative compared to the base directory.

basedirThe base directory.
namesThe relative path names.
The directory at the given path or null if it cannot be created.
NullPointerExceptionIf any of the arguments or path names are null.
InvalidPathFormatExceptionIf any of the path name has invalid format.
Overridden from: TaskExecutionUtilities
Resolves a file but not a directory using the given absolute path.
pathThe absolute path.
The resolved file or null if not found or it's a directory.
NullPointerExceptionIf the path is null.
InvalidPathFormatExceptionIf the path is not absolute.
Overridden from: TaskExecutionUtilities
Same as TaskExecutionUtilities.resolveFileAtPath(SakerPath), but uses the specified base directory to resolve relative paths.
basedirThe base directory.
pathThe path to resolve.
The found file at the given path or null if not found or it's a directory.
NullPointerExceptionIf path is null, or path is relative and base directory is null.
Overridden from: TaskExecutionUtilities
Resolves a file but not a directory at the given path.

If the path is relative, it will be resolved against the current task working directory.

If it is absolute, the execution root directories will be used as a base of resolution.

pathThe path to resolve.
The found file at the given path or null if not found or it's a directory.
NullPointerExceptionIf the path is null.
Overridden from: TaskExecutionUtilities
Resolves a file but not a directory using the given relative path against a base directory.
basedirThe base directory.
pathThe relative path.
The resolved file or null if not found.
NullPointerExceptionIf any of the arguments are null.
InvalidPathFormatExceptionIf the path is not relative.
Overridden from: TaskExecutionUtilities
Resolves a file but not a directory with the given path names against a base directory.

The path names are interpreted as if they were relative compared to the base directory.

basedirThe base directory.
namesThe relative path names.
The resolved file or null if not found or it's a directory.
NullPointerExceptionIf any of the arguments or path names are null.
InvalidPathFormatExceptionIf any of the path name has invalid format.
Overridden from: TaskExecutionUtilities
Same as TaskExecutionUtilities.runTask(TaskIdentifier, TaskFactory<?>, TaskExecutionParameters) with the arguments derived from the specified launch arguments.
taskThe launch arguments of the task.
TaskIdentifierConflictExceptionIf a task with the same identifier is already started and the task factories does not equal.
NullPointerExceptionIf task identifier or task factory is null.
IllegalTaskOperationExceptionIf the task identifier is the same as the caller.
Overridden from: TaskExecutionUtilities
taskidThe task identifier for the task to run.
taskfactoryThe task factory of the task.
TaskIdentifierConflictExceptionIf a task with the same identifier is already started and the task factories does not equal.
NullPointerExceptionIf task identifier or task factory is null.
IllegalTaskOperationExceptionIf the task identifier is the same as the caller.
Overridden from: TaskExecutionUtilities
taskidThe task identifier for the task to run.
taskfactoryThe task factory of the task.
parametersThe task execution parameters, or null to use the defaults.
TaskIdentifierConflictExceptionIf a task with the same identifier is already started and the task factories does not equal.
NullPointerExceptionIf task identifier or task factory is null.
IllegalTaskOperationExceptionIf the task identifier is the same as the caller.
Overridden from: TaskExecutionUtilities
Same as TaskExecutionUtilities.runTaskFuture(TaskIdentifier, TaskFactory<R>, TaskExecutionParameters) with the arguments derived from the specified launch arguments.
RThe result type of the task.
taskThe launch arguments of the task.
A future handle for the run task.
TaskIdentifierConflictExceptionIf a task with the same identifier is already started and the task factories does not equal.
NullPointerExceptionIf task identifier or task factory is null.
IllegalTaskOperationExceptionIf the task identifier is the same as the caller.
Overridden from: TaskExecutionUtilities
Convenience function to call TaskExecutionUtilities.runTaskFuture(TaskIdentifier, TaskFactory<R>, TaskExecutionParameters) with the default task execution parameters.
RThe result type of the task.
taskidThe task identifier for the task to run.
taskfactoryThe task factory of the task.
A future handle for the run task.
TaskIdentifierConflictExceptionIf a task with the same identifier is already started and the task factories does not equal.
NullPointerExceptionIf any of the arguments are null.
IllegalTaskOperationExceptionIf the task identifier is the same as the caller.
Overridden from: TaskExecutionUtilities
Starts a task and waits for its execution to complete.

This method is similar to TaskExecutionUtilities.runTaskResult(TaskIdentifier, TaskFactory<R>, TaskExecutionParameters), but doesn't add a dependency for the task, and returns a TaskFuture instance to the caller.

RThe result type of the task.
taskidThe task identifier for the task to run.
taskfactoryThe task factory of the task.
parametersThe task execution parameters, or null to use the defaults.
A future handle for the run task.
TaskIdentifierConflictExceptionIf a task with the same identifier is already started and the task factories does not equal.
NullPointerExceptionIf task identifier or task factory is null.
IllegalTaskOperationExceptionIf the task identifier is the same as the caller.
Overridden from: TaskExecutionUtilities
Same as TaskExecutionUtilities.runTaskResult(TaskIdentifier, TaskFactory<R>, TaskExecutionParameters) with the arguments derived from the specified launch arguments.
RThe result type of the task.
taskThe launch arguments of the task.
The result of the task execution.
TaskIdentifierConflictExceptionIf a task with the same identifier is already started and the task factories does not equal.
NullPointerExceptionIf task identifier or task factory is null.
IllegalTaskOperationExceptionIf the task identifier is the same as the caller.
TaskExecutionFailedExceptionIf the task execution resulted in an exception.
Overridden from: TaskExecutionUtilities
Convenience function to call TaskExecutionUtilities.runTaskResult(TaskIdentifier, TaskFactory<R>, TaskExecutionParameters) with the default task execution parameters.
taskidThe task identifier for the task to run.
taskfactoryThe task factory of the task.
The result of the task execution.
NullPointerExceptionIf any of the arguments are null.
IllegalTaskOperationExceptionIf the task identifier is the same as the caller.
Overridden from: TaskExecutionUtilities
Starts a task and waits for its execution to complete.

A task dependency will be added for the started task with the same rules as in TaskContext.getTaskResult(TaskIdentifier).

taskidThe task identifier for the task to run.
taskfactoryThe task factory of the task.
parametersThe task execution parameters, or null to use the defaults.
The result of the task execution.
TaskIdentifierConflictExceptionIf a task with the same identifier is already started and the task factories does not equal.
NullPointerExceptionIf task identifier or task factory is null.
TaskExecutionFailedExceptionIf the task execution resulted in an exception.
IllegalTaskOperationExceptionIf the task identifier is the same as the caller.
public void setMetaData(String metadataid, Object value) throws NullPointerException
Overridden from: TaskContext
Sets an arbitrary meta-data as a result of this task.

Meta-datas can be used by the executing environment (e.g. IDEs, custom launchers) to extract information from the executed tasks.

metadataidThe identifier of the meta-data. Should follow package naming conventions.
valueThe value to set as meta-data.
NullPointerExceptionIf any of the parameters are null.
Overridden from: TaskContext
Sets the line display identifier for this task.

The line display identifier is prepended to each line printed to the standard output during the execution. The identifier format is surrounded by brackets. (E.g. [<identifier>])

The display identifier is not printed to the standard error output.

displayidThe display id to set. Pass null to disable it.
public void setTaskOutput(Object tag, Object value) throws NullPointerException
Overridden from: TaskContext
Sets the output of the task for a given tag.

Arbitrary tag-value pairs can be set as a task output which can be retrieved in a later execution when the task is incrementally invoked.

The tags and values should be preferrably Externalizable, but at least Serializable.

The build system does not handle these tags and values in a special way. They only serve a purpose of storing arbitrary data between incremental executions of the same task.

The tags should implement Object.equals(Object) and Object.hashCode(). If this method is called multiple times with the same tag, then the latter value will be associated with the given tag.

tagAn arbitrary tag to associate the value with.
valueThe value to set.
NullPointerExceptionIf tag or value is null.
Overridden from: TaskContext
Starts an inner task to execute in the context of this task.

This method will start an inner task execution using the given task factory and parameters.

Inner tasks are handled in a completely different way as plain tasks. The are ought to be treated as a simple function that runs in the same task context as this task. When you start an inner task, the build system will instantiate a task object from the task factory, and run it with the same task context as this for its parameter. Any depedencies, and operations that the inner task executes will behave the same way if the caller task executed it.

Inner tasks don't have a task identifier. They are not tracked by the build system, and they are not automatically rerun when incremental changes are detected. The build system will not store the inner tasks between executions, and will not emit deltas if the associated task factories are changed.

As they don't have a task identifier, they are allowed to execute multiple times. As they are only valid in the context of the enclosing task, they are allowed to share state between them in regards to the enclosing task context.

The main reason of using inner tasks is to fine-grain the performance of a composite task. As inner tasks can share state, it may be beneficial for a task to split up its work into smaller inner tasks while possibly dispatching the work to remote clusters or balancing the load with computation tokens.

The build system will handle the additional methods of TaskFactory which specify where and how the task can be invoked. The capabilities of the tasks are taken into account when invoking inner tasks.

Inner tasks cannot be cacheable. As they are not explicitly tracked by the build system, caching them is not allowed. If you need to cache inner tasks, consider using normal subtasks instead.

If the inner task reports computation tokens, then the enclosing task must report the TaskFactory.CAPABILITY_INNER_TASKS_COMPUTATIONAL capability to ensure proper operation. This is in order to ensure that the enclosing task complies with the restrictions that computation token usage imposes.

Inner tasks may be declared to be short, in which case they behave the same way normal tasks would work. They are invoked a single time and are not duplicated (see below). Generally, using short inner tasks have limited use-cases, as the work the inner task does can be executed directly in the enclosing task.

Inner tasks can select their execution environment the same way as normal tasks do. See TaskFactory.getExecutionEnvironmentSelector(). The execution environment selector will be used to find only one suitable environment. When duplication is used, any further execution environments will be chosen automatically based on the reported qualifier properties. If all of the qualifier properties match on a candidate environment, it will be added to the duplicateable environments without checking the suitability again with the environment selector.
Note: The qualifier environment properties will not be automatically added as a dependency for the task.

The inner task is being run based on the above mentioned capabilities and the execution parameters of this function. When specified so using the parameters, the inner tasks can be duplicated to other build clusters used by the current build execution. In this case the build system will dispatch the tasks to the appropriate clusters and execute them possibly multiple times on each one. This process is called duplication.

Inner task duplication occurrs with respect to the selected suitable execution environments and reported computation tokens. Duplication is useful when the enclosing task can divide its work up in a way that one execution unit will correspond to one inner task, but doesn't care about where the task is being executed. In this case the task can use as much computational resources that is available to it, therefore maximizing the build performance.

The result of this function is an object that provides access to the results of the inner tasks. The returned object can have zero, single, or multiple results of the inner tasks. As the number of times the task is invoked dependends on the specified execution parameters, it cannot be determined how many times the inner task will actually be duplicated. The returned object can be thought as an iterator on the results of the inner tasks.

The enclosing tasks are not required to wait for the completions of the inner tasks. If the Task.run(TaskContext) method of the enclosing task finishes before all of the inner tasks complete, the build system will wait for the inner tasks to complete, and then deem the enclosing task to be finished. When such scenario happens, the inner task duplications are automatically cancelled if the execution parameters permit. If any inner tasks throw an exception during the finalization of the enclosing task will cause the enclosing task to fail as a result.

Inner task factories are not required to implement any serialization related functionality, only of there is remote execution involved. In that case the caller should make sure to properly transfer the task factory and any shared states over RMI.

RThe result type of the inner task execution.
taskfactoryThe inner task factory to execute.
parametersThe execution parameters for the inner task or null to use the defaults.
The results object for the started inner task(s).
NullPointerExceptionIf the task factory is null.
InvalidTaskInvocationConfigurationExceptionIf the task factory reports conflicting/invalid configuration for inner tasks.
TaskEnvironmentSelectionFailedExceptionIf the task factory failed to select a suitable environment to execute on. This exception may be delayed until the first call to InnerTaskResults.getNext().
InnerTaskInitializationExceptionIf the starting of the inner tasks failed on the all of the selected execution environments.
Overridden from: TaskExecutionUtilities
Convenience function to call TaskContext.startTask(TaskIdentifier, TaskFactory<R>, TaskExecutionParameters).

This method returns no result.

taskThe launch arguments of the task.
TaskIdentifierConflictExceptionIf a task with the same identifier is already started and the task factories does not equal.
NullPointerExceptionIf any of the arguments are null.
IllegalTaskOperationExceptionIf the task identifier is the same as the caller.
Overridden from: TaskExecutionUtilities
Convenience function to call TaskContext.startTask(TaskIdentifier, TaskFactory<R>, TaskExecutionParameters) with the default task execution parameters.

This method returns no result.

taskidThe task identifier for the task to run.
taskfactoryThe task factory of the task.
TaskIdentifierConflictExceptionIf a task with the same identifier is already started and the task factories does not equal.
NullPointerExceptionIf any of the arguments are null.
IllegalTaskOperationExceptionIf the task identifier is the same as the caller.
Overridden from: TaskContext
Starts a task for execution.

Calling this method will post the specified task for execution to the build runtime. The time of execution is unspecified, can be run instantly, delayed to a later time, or started concurrently.

This method will raise a TaskIdentifierConflictException if the task with the same identifier was already started previously (by this or an other task) and the specified task factories does not equal. Important: It will not raise an exception if a task was already started previously but the execution parameters are different. If one needs to execute some task that relies on specific execution parameters, then the relevant parts of the execution parameters should be included in the task identifier as well.

For more convenient methods to start tasks, see TaskContext.getTaskUtilities().

RThe result type of the started task.
taskidThe identifier for the task.
taskfactoryThe task factory to use for the started task.
parametersThe task execution parameters, or null to use the defaults.
A future handle for the started task.
TaskIdentifierConflictExceptionIf a task with the same identifier is already started and the task factories does not equal.
NullPointerExceptionIf task identifier or task factory is null.
IllegalTaskOperationExceptionIf the task identifier is the same as the caller.
Overridden from: TaskExecutionUtilities
RThe result type of the task
taskThe launch arguments of the task.
A future handle for the started task.
TaskIdentifierConflictExceptionIf a task with the same identifier is already started and the task factories does not equal.
NullPointerExceptionIf any of the arguments are null.
IllegalTaskOperationExceptionIf the task identifier is the same as the caller.
Overridden from: TaskExecutionUtilities
Convenience function to call TaskContext.startTask(TaskIdentifier, TaskFactory<R>, TaskExecutionParameters) with the default task execution parameters.
RThe result type of the task
taskidThe task identifier for the task to run.
taskfactoryThe task factory of the task.
A future handle for the started task.
TaskIdentifierConflictExceptionIf a task with the same identifier is already started and the task factories does not equal.
NullPointerExceptionIf any of the arguments are null.
IllegalTaskOperationExceptionIf the task identifier is the same as the caller.
Overridden from: TaskExecutionUtilities
Batch function for starting tasks specified by the launch arguments.

This function starts every task with the parameters specified by each launch arguments.

This function works the same way as if TaskExecutionUtilities.startTask(TaskLaunchArguments<?>) was called for each element in the argument.

This function returns void, to retrieve the futures for the started tasks as well, use TaskExecutionUtilities.startTasksFuture(Iterable<extends TaskLaunchArguments<?>>).

tasksThe tasks to start.
TaskIdentifierConflictExceptionIf a task with the same identifier is already started and the task factories does not equal.
NullPointerExceptionIf any of the arguments or elements are null.
IllegalTaskOperationExceptionIf a task identifier is the same as the caller.
Overridden from: TaskExecutionUtilities
Batch function for starting multiple tasks.

The started tasks will use the default execution parameters.

This function works the same way as TaskExecutionUtilities.startTasks(Map<extends TaskIdentifier, ? extends TaskFactory<?>>, TaskExecutionParameters) with null execution parameters.

tasksThe collection of tasks to start.
TaskIdentifierConflictExceptionIf a task with the same identifier is already started and the task factories does not equal.
NullPointerExceptionIf any of the arguments or elements are null.
IllegalTaskOperationExceptionIf a task identifier is the same as the caller.
Overridden from: TaskExecutionUtilities
Batch function for starting multiple tasks with the specified execution parameters.

The passed execution parameters will be used for each started task. If null, the default parameters will be used.

tasksThe collection of tasks to start.
parametersThe execution parameter to start the tasks with.
TaskIdentifierConflictExceptionIf a task with the same identifier is already started and the task factories does not equal.
NullPointerExceptionIf any of the arguments or elements are null.
IllegalTaskOperationExceptionIf a task identifier is the same as the caller.
Overridden from: TaskExecutionUtilities
Batch function for starting tasks with the specified launch arguments and retrieving the futures for them.

This function works the same way as if TaskExecutionUtilities.startTaskFuture(TaskLaunchArguments<R>) was called for each element in the argument.

The returned list of task futures will have the same order as the argument iterable.

tasksThe tasks to start
The futures for the started tasks in the same order as the argument iterable.
TaskIdentifierConflictExceptionIf a task with the same identifier is already started and the task factories does not equal.
NullPointerExceptionIf any of the arguments or elements are null.
IllegalTaskOperationExceptionIf a task identifier is the same as the caller.
Overridden from: TaskExecutionUtilities
Executes synchronization of files from the given source path to the specified target path.

This method synchronizes the contents of the source path file to the target path.

If the source file is a file, its contents will be updated to the target path. If a file already exists at the target path, it will be overwritten. Parent directories will be created at the target path if necessary. Specifying the flag TaskExecutionUtilities.SYNCHRONIZE_FLAG_NO_OVERWRITE_DIRECTORY will cause the synchronization to throw an exception if a non-empty directory already exists at the target. Empty directories at the target path will be deleted and overwritten with the byte contents of the source file.

If the source file is a directory, then a directory will be created at the target path. Children of the source directory are not synchronized. If a file already exists at the target path, it will be deleted and a directory is created instead. If a directory already exists at the target path, no operations are done. Parent directories are created appropriately.

sourceThe source path key.
targetThe synchronization target path key.
syncflagThe synchronization flags. 0, or any of the SYNCHRONIZE_FLAG_* constants in the class.
The content descriptor that is associated with the synchronized contents.
IOExceptionIn case of I/O error.
NullPointerExceptionIf any of the arguments are null.
Overridden from: TaskExecutionUtilities
Converts the given files to a map with their retrieved paths as keys and content descriptors as values.

The implementation doesn't examine the nature of the retrieved paths. If there are conflicting paths, then the resulting map may be smaller in size than the passed input. E.g. If multiple files have no parent, but same file name, only one will be in the result map with its name.

When calling this during remote execution, it is recommended that the files reside on the coordinator machine.

filesThe files to map to their paths and contents.
A new map of paths mapped to the corresponding content descriptors.
NullPointerExceptionIf the files or any of its elements are null.
Overridden from: TaskExecutionUtilities
Converts the given files to a map with their retrieved paths as keys.

The implementation doesn't examine the nature of the retrieved paths. If there are conflicting paths, then the resulting map may be smaller in size than the passed input. E.g. If multiple files have no parent, but same file name, only one will be in the result map with its name.

When calling this during remote execution, it is recommended that the files reside on the coordinator machine.

filesThe files to map to their paths.
A new map of paths mapped to the corresponding files.
NullPointerExceptionIf the files or any of its elements are null.
Overridden from: TaskExecutionUtilities
Writes the contents of the file to the specified output stream.

Calling this method might implicitly synchronize the file to its real location, or to some other cache location when remote execution is used.

fileThe file.
osThe output stream to write the contents of the file to.
IOExceptionIn case of I/O error.
NullPointerExceptionIf any of the arguments are null.
Overridden from: TaskExecutionUtilities
Writes the contents of the file to the specified byte sink.

Calling this method might implicitly synchronize the file to its real location, or to some other cache location when remote execution is used.

fileThe file.
osThe byte sink to write the contents of the file to.
IOExceptionIn case of I/O error.
NullPointerExceptionIf any of the arguments are null.