Skip to content

Commit 42c651a

Browse files
committed
Developing DevOps Tool
1 parent 6cc8156 commit 42c651a

File tree

5 files changed

+48
-3
lines changed

5 files changed

+48
-3
lines changed

docs/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ <h3 id="_multi_documents">Multi Documents</h3>
659659
<div id="footer">
660660
<div id="footer-text">
661661
Version 1.0<br>
662-
Last updated 2019-09-19 08:15:02 +0600
662+
Last updated 2019-09-18 22:52:00 +0600
663663
</div>
664664
</div>
665665
<style>

docs/topics/bismillah.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@
445445
<div id="footer">
446446
<div id="footer-text">
447447
Version 1.0<br>
448-
Last updated 2019-09-15 16:25:15 +0600
448+
Last updated 2019-09-15 20:36:37 +0600
449449
</div>
450450
</div>
451451
</body>

docs/topics/yml.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@ <h3 id="_multi_documents">Multi Documents</h3>
646646
<div id="footer">
647647
<div id="footer-text">
648648
Version 1.0<br>
649-
Last updated 2019-09-19 08:15:02 +0600
649+
Last updated 2019-09-18 23:29:17 +0600
650650
</div>
651651
</div>
652652
<style>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
package com.hmtmcse.jtfutil.io.watcher;
2+
3+
import java.io.IOException;
4+
import java.nio.file.*;
5+
6+
public class DirectoryWatcher {
7+
8+
9+
public static void watch(String location) {
10+
try {
11+
WatchService watchService = FileSystems.getDefault().newWatchService();
12+
Path path = Paths.get(location);
13+
path.register(watchService, StandardWatchEventKinds.ENTRY_CREATE, StandardWatchEventKinds.ENTRY_DELETE, StandardWatchEventKinds.ENTRY_MODIFY);
14+
15+
WatchKey key;
16+
Integer j = 0;
17+
while ((key = watchService.take()) != null) {
18+
Integer i = 0;
19+
for (WatchEvent<?> event : key.pollEvents()) {
20+
System.out.println("Event kind:" + event.kind() + ". File affected: " + event.context() + ". " + i);
21+
i++;
22+
}
23+
System.out.println("Touhid: " + j);
24+
j++;
25+
key.reset();
26+
}
27+
28+
} catch (IOException e) {
29+
e.printStackTrace();
30+
} catch (InterruptedException e) {
31+
e.printStackTrace();
32+
}
33+
}
34+
35+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package com.hmtmcse.jtfutil.test;
2+
3+
import com.hmtmcse.jtfutil.io.watcher.DirectoryWatcher;
4+
5+
public class TestWatch {
6+
7+
public static void main(String[] args) {
8+
DirectoryWatcher.watch("C:\\Users\\hmtmc\\OneDrive\\Desktop\\resources");
9+
}
10+
}

0 commit comments

Comments
 (0)