Class FileChangeTriggerBuilder
java.lang.Object
com.inet.taskplanner.server.api.trigger.FileChangeTriggerBuilder
Use this to construct a
TriggerDefinition for a file-change trigger.
A file-change trigger needs one file path to be configured. The file path must be absolute and cannot denote a root directory (such as C:\ or /).
Example usage:
TaskDefinition task = new TaskDefinition( "mytask" );
TriggerDefinition definition = FileChangeTriggerBuilder.createForFolder( "D:\\Documents\\Reports" );
task.addTrigger( definition );
// add jobs and actions
TaskPlanner.getInstance().addTask( task, userID );
- Since:
- taskplanner 3.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic TriggerDefinitioncreateForFile(String path) Creates a new definition for a file-change trigger using the given path string.static TriggerDefinitioncreateForFile(Path path) Creates a new definition for a file-change trigger using the given path.static TriggerDefinitioncreateForFolder(String path) Creates a new definition for a file-change trigger using the given path string.static TriggerDefinitioncreateForFolder(Path path) Creates a new definition for a file-change trigger using the given path.
-
Constructor Details
-
FileChangeTriggerBuilder
public FileChangeTriggerBuilder()
-
-
Method Details
-
createForFile
Creates a new definition for a file-change trigger using the given path string.- Parameters:
path- absolute path that denotes file.- Returns:
- the definition which can be added to the task.
- Throws:
IllegalArgumentException- if the given path string is null, cannot be converted to a Path, is not absolute, or denotes the root directory.- Since:
- taskplanner 3.0
-
createForFile
Creates a new definition for a file-change trigger using the given path.- Parameters:
path- absolute path that denotes file.- Returns:
- the definition which can be added to the task.
- Throws:
IllegalArgumentException- if the given path is null, is not absolute, or denotes the root directory.- Since:
- taskplanner 3.0
-
createForFolder
Creates a new definition for a file-change trigger using the given path string.- Parameters:
path- absolute path that denotes folder.- Returns:
- the definition which can be added to the task.
- Throws:
IllegalArgumentException- if the given path string is null, cannot be converted to a Path, is not absolute, or denotes the root directory.- Since:
- taskplanner 3.0
-
createForFolder
Creates a new definition for a file-change trigger using the given path.- Parameters:
path- absolute path that denotes folder.- Returns:
- the definition which can be added to the task.
- Throws:
IllegalArgumentException- if the given path is null, is not absolute, or denotes the root directory.- Since:
- taskplanner 3.0
-