Change permissions on files or directories.
Task package: | org.schmant.task.base |
Java package: | org.schmant.task.io |
Category: | Unix tasks |
Since: | 0.5 |
EntityFS-aware? | Yes* |
Implements: | ActionTaskFactory |
Restriction: | Works only on Unix since it uses the chmod
command. |
Description:
Uses the chmod(1)
operating system command to change the
file mode bits for one or several files or directories.
Required properties
Properties
logFooter | top |
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
logHeader | top |
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
permission (required) | top |
The file or directory permission to set.
- Setter method:
setPermission(String mode)
parameters:mode
– The permission represented as a string that thechmod
command can understand. For instanceugo+rx
or754
reportLevel | top |
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 levelparameters:l
– The new report level.
sources (required) | top |
A collection of files or directories to change permissions for.
- Setter method:
addSource(Object o)
Add one or several files and/or directories.parameters:o
– One file or directory or an array or collection of files and/or directories.
Interpreted byInterpretAsFileStrategy
.- Setter method:
addSources(Object o)
Add one or several files and/or directories.parameters:o
– One file or directory or an array or collection of files and/or directories.
Interpreted byInterpretAsFileStrategy
.- Setter method:
clearSources()
Discard all files.- Setter method:
setSource(Object o)
Set one or several files and/or directories, discarding previously set sources.parameters:o
– One file or directory or an array or collection of files and/or directories.
Interpreted byInterpretAsFileStrategy
.- Setter method:
setSources(Object o)
Set one or several files and/or directories, discarding previously set sources.parameters:o
– One file or directory or an array or collection of files and/or directories.
Interpreted byInterpretAsFileStrategy
.
traceLogging | top |
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
Example 1
Set the schmant.sh
script to be
executable. binDir
is the Schmant distribution's bin
directory.
JavaScript
* 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.