1
1
# FolderWatcher Binding
2
2
3
- This binding is intended to monitor FTP, local folder and S3 bucket and its subfolders and notify of new files
3
+ This binding is intended to monitor a local folder, FTP and S3 bucket and their subfolders and notify of new files.
4
4
5
5
## Supported Things
6
6
7
- Currently the binding support three types of things: ` ftpfolder ` , ` localfolder ` and ` s3bucket ` .
7
+ The binding support three types of things: ` localfolder ` , ` ftpfolder ` and ` s3bucket ` .
8
8
9
9
## Thing Configuration
10
10
11
- The ` ftpfolder ` thing has the following configuration options:
11
+ The ` localfolder ` thing has the following configuration options:
12
12
13
- | Parameter | Name | Description | Required | Default value |
14
- | -------------------| --------------------------| -------------------------------------| ----------| ---------------|
15
- | ftpAddress | FTP server | IP address of FTP server | yes | n/a |
16
- | ftpPort | FTP port | Port of FTP server | yes | 21 |
17
- | secureMode | FTP Security | FTP Security | yes | None |
18
- | ftpUsername | Username | FTP user name | yes | n/a |
19
- | ftpPassword | Password | FTP password | yes | n/a |
20
- | ftpDir | RootDir | Root directory to be watched | yes | n/a |
21
- | listRecursiveFtp | List Sub Folders | Allow listing of sub folders | yes | No |
22
- | listHidden | List Hidden | Allow listing of hidden files | yes | false |
23
- | connectionTimeout | Connection timeout, s | Connection timeout for FTP request | yes | 30 |
24
- | pollInterval | Polling interval, s | Interval for polling folder changes | yes | 60 |
25
- | diffHours | Time stamp difference, h | How many hours back to analyze | yes | 24 |
13
+ | Parameter | Name | Description | Required | Default value |
14
+ | ------------------ | --------------------------- | ----------------------------------- | -------- | ------------- |
15
+ | localDir | Local Directory | Local directory to be watched | yes | n/a |
16
+ | listHiddenLocal | List Hidden | Allow listing of hidden files | yes | No |
17
+ | pollIntervalLocal | Polling interval in seconds | Interval for polling folder changes | yes | 60 |
18
+ | listRecursiveLocal | List Sub Folders | Allow listing of sub folders | yes | No |
26
19
27
- The ` localfolder ` thing has the following configuration options:
20
+ The ` ftpfolder ` thing has the following configuration options:
28
21
29
- | Parameter | Name | Description | Required | Default value |
30
- | --------------------| ---------------------| -------------------------------------| ----------| ---------------|
31
- | localDir | Local Directory | Local directory to be watched | yes | n/a |
32
- | listHiddenLocal | List Hidden | Allow listing of hidden files | yes | No |
33
- | pollIntervalLocal | Polling interval, s | Interval for polling folder changes | yes | 60 |
34
- | listRecursiveLocal | List Sub Folders | Allow listing of sub folders | yes | No |
22
+ | Parameter | Name | Description | Required | Default value |
23
+ | ----------------- | ------------------------------ | ----------------------------------- | -------- | ------------- |
24
+ | ftpAddress | FTP server | IP address of FTP server | yes | n/a |
25
+ | ftpPort | FTP port | Port of FTP server | yes | 21 |
26
+ | secureMode | FTP Security | FTP Security | yes | None |
27
+ | ftpUsername | Username | FTP user name | yes | n/a |
28
+ | ftpPassword | Password | FTP password | yes | n/a |
29
+ | ftpDir | RootDir | Root directory to be watched | yes | n/a |
30
+ | listRecursiveFtp | List Sub Folders | Allow listing of sub folders | yes | No |
31
+ | listHidden | List Hidden | Allow listing of hidden files | yes | false |
32
+ | connectionTimeout | Connection timeout in seconds | Connection timeout for FTP request | yes | 30 |
33
+ | pollInterval | Polling interval in seconds | Interval for polling folder changes | yes | 60 |
34
+ | diffHours | Time stamp difference in hours | How many hours back to analyze | yes | 24 |
35
35
36
36
The ` s3bucket ` thing has the following configuration options:
37
37
@@ -46,7 +46,7 @@ The `s3bucket` thing has the following configuration options:
46
46
| s3Anonymous | Anonymous Connection | Connect anonymously (works for public buckets) | yes | true |
47
47
## Events
48
48
49
- This binding currently supports the following events :
49
+ This binding supports the following event :
50
50
51
51
| Channel Type ID | Item Type | Description |
52
52
| -----------------| -----------| ----------------------------|
@@ -57,49 +57,43 @@ This binding currently supports the following events:
57
57
Thing configuration:
58
58
59
59
``` java
60
- folderwatcher: localfolder: myLocalFolder [ localDir= " /myfolder" , pollIntervalLocal= 60 , listHiddenLocal= " false" , listRecursiveLocal= " false" ]
60
+ folderwatcher: localfolder: myLocalFolder [ localDir= " /myfolder" , pollIntervalLocal= 60 , listHiddenLocal= " false" , listRecursiveLocal= " false" ]
61
61
folderwatcher: ftpfolder: myLocalFolder [ ftpAddress= " X.X.X.X" , ftpPort= 21 , secureMode= " EXPLICIT" , ftpUsername= " username" , ftpPassword= " password" , ftpDir= " /myfolder/" , listHidden= " true" , listRecursiveFtp= " true" , connectionTimeout= 33 , pollInterval= 66 , diffHours= 25 ]
62
62
folderwatcher: s3bucket: myS3bucket [ s3BucketName= " mypublic-bucket" , pollIntervalS3= 60 , awsRegion= " us-west-1" , s3Anonymous= " true" ]
63
63
64
64
```
65
65
66
66
### Using in a rule:
67
67
68
- FTP example:
68
+ Local folder example:
69
69
70
70
``` java
71
- rule " New FTP file"
72
- when
73
- Channel " folderwatcher:ftpfolder:myLocalFolder :newfile" triggered
71
+ rule " New Local file"
72
+ when
73
+ Channel " folderwatcher:localfolder:myFTPFolder :newfile" triggered
74
74
then
75
-
76
- logInfo(" NewFTPFile" , receivedEvent. toString())
77
-
75
+ logInfo(" NewLocalFile" , receivedEvent. toString())
78
76
end
79
77
```
80
78
81
- Local folder example:
79
+ FTP example:
82
80
83
81
``` java
84
- rule " New Local file"
85
- when
86
- Channel " folderwatcher:localfolder:myFTPFolder :newfile" triggered
82
+ rule " New FTP file"
83
+ when
84
+ Channel " folderwatcher:ftpfolder:myLocalFolder :newfile" triggered
87
85
then
88
-
89
- logInfo(" NewLocalFile" , receivedEvent. toString())
90
-
86
+ logInfo(" NewFTPFile" , receivedEvent. toString())
91
87
end
92
88
```
93
89
94
90
S3 bucket example:
95
91
96
92
``` java
97
93
rule " New S3 file"
98
- when
94
+ when
99
95
Channel " folderwatcher:s3bucket:myS3bucket:newfile" triggered
100
96
then
101
-
102
97
logInfo(" NewS3File" , receivedEvent. toString())
103
-
104
98
end
105
99
```
0 commit comments