BBjFileSystem::watchDirectory
Description
In BBj 17.00 and higher, this method watches the specified directory for changes (create, modify, delete), periodically reporting any changes through the specified callback.
Syntax
| Return Value | Method |
|---|---|
|
String |
watchDirectory(String directory, String label) |
|
String |
watchDirectory(String directory, CustomObject customObj, String methodName) |
| String |
watchDirectory(String directory, Object object, String methodName) |
Parameters
| Parameter | Description |
|---|---|
| directory | The directory to be watched. |
| label | The subroutine to be invoked to report any directory changes. |
| customObj | A CustomObject containing the method to be called to report any directory changes |
| methodName | An Object containing the method to be called to report any directory changes. |
| object | A Java Object containing the method to be called to report any directory changes |
Return Value
Returns the full directory path.
Remarks
When registering a CustomObject method as the target of the callback, the method must conform to the following constraints:
-
The method must be declared as public with a return type of void.
-
The method must accept a single parameter.
The type of the method parameter must be either BBjDirectoryChangeEvent or BBjEvent or Object.
To stop watching a directory, see unwatchDirectory or unwatchAllDirectories.
Example
|
Version History
See Also
BBjFileSystem::unwatchDirectory
BBjFileSystem::unwatchAllDirectories
See the BBj Object Diagram for an illustration of the relationship between BBj Objects.