ReplaceSourceFileTF

Replace the source file of one or more proxied process tasks with the target the last task generates.

Task package:org.schmant.task.base
Java package:org.schmant.task.proxy
Category:Meta tasks
Since:0.5
EntityFS-aware?Yes*
Implements:ActionTaskFactory
See also:RecursiveActionTF

Description:

Replace the source file of one or several process tasks with the target file created by the last task. This turns the process tasks into action tasks.

If several process tasks are used, the result from task n is used as the source for task n + 1. The original source file is replaced with the target from the last task.

This may work for directory sources too, but that depends on the proxied task(s).

Required properties

Properties

logFootertop

The message that is logged to info level after the task has been successfully run.

Setter method:
setLogFooter(String s)
parameters:
s – The footer message.
Default value:
Empty (no footer message is logged.)
See also:
logHeader
logHeadertop

The message that is logged to info level before the task is run.

Setter method:
setLogHeader(String s)
parameters:
s – The header message.
Default value:
A task class specific message.
See also:
logFooter
reportLeveltop

This property is used to change the Report level for all task created by this task factory. The report level is changed for the thread running the task when the it is run, and is restored to its previous level when the it is done.

Setter method:
setReportLevel(Level l)
Set the report level
parameters:
l – The new report level.
source (required)top

The source entity that will be processed by the proxied task and then overwritten with the proxied task's target entity.

Setter method:
setSource(Object o)
parameters:
o – The source.
Interpreted by InterpretAsEntityStrategy.
taskFactories (required)top

A list of process task factories and/or closures. Each processed file will be processed by a task from every task factory and by all closures.

For process task factories, a new task object is created for each processed entity.

For closures, the same closure instance will be run for each processed entity. The closure is called with one argument of the type ClosureParameters.

Setter method:
addTaskFactories(Object o)
Add one or several process task factories and/or closures.
parameters:
o – One or several ProcessTaskFactory:s and/or closures.
Setter method:
addTaskFactory(java.lang.Object f)
Add one process task factory or closure.
parameters:
f – A ProcessTaskFactory or a closure.
Setter method:
clearTaskFactories()
Clear the list of task factories.
Setter method:
setTaskFactory(java.lang.Object f)
Set one process task factory or closure and discard all previously set task factories and closures.
parameters:
f – A ProcessTaskFactory or a closure.
traceLoggingtop

If trace logging is enabled for a task, it reports its configuration before it is run.

Trace logging may also be enabled globally for all tasks by calling TraceMode.setTraceMode(boolean).

Setter method:
setTraceLogging(boolean b)
Enable or disable trace logging.
parameters:
b – Enable trace logging?

Examples

See RecursiveActionTF examples two and three.

* An EntityFS-aware task is implemented using EntityFS. This means that it uses the filter settings of DirectoryView:s and also that it often can work with other file system implementations than File-based, such as the RAM file system.