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 has to be absolute and can not denote root directory (like 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 );
- Since:
- taskplanner 3.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic TriggerDefinitioncreateForFile(String path) Create a new Definition for a file change Trigger using given path string.static TriggerDefinitioncreateForFile(Path path) Create a new Definition for a file change Trigger using given path.static TriggerDefinitioncreateForFolder(String path) Create a new Definition for a file change Trigger using given path string.static TriggerDefinitioncreateForFolder(Path path) Create a new Definition for a file change Trigger using given path.
-
Constructor Details
-
FileChangeTriggerBuilder
public FileChangeTriggerBuilder()
-
-
Method Details
-
createForFile
Create a new Definition for a file change Trigger using given path string.- Parameters:
path- absolute path that denotes file.- Returns:
- the definition which can be added to the task.
- Throws:
IllegalArgumentException- if given path string is null, path string cannot be converted to a Path, path is not absolute or denotes root component.- Since:
- taskplanner 3.0
-
createForFile
Create a new Definition for a file change Trigger using given path.- Parameters:
path- absolute path that denotes file.- Returns:
- the definition which can be added to the task.
- Throws:
IllegalArgumentException- if given path is null, not absolute or denotes root component.- Since:
- taskplanner 3.0
-
createForFolder
Create a new Definition for a file change Trigger using given path string.- Parameters:
path- absolute path that denotes folder.- Returns:
- the definition which can be added to the task.
- Throws:
IllegalArgumentException- if given path string is null, path string cannot be converted to a Path, path is not absolute or denotes root component.- Since:
- taskplanner 3.0
-
createForFolder
Create a new Definition for a file change Trigger using given path.- Parameters:
path- absolute path that denotes folder.- Returns:
- the definition which can be added to the task.
- Throws:
IllegalArgumentException- if given path is null, not absolute or denotes root component.- Since:
- taskplanner 3.0
-