You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* <li>Either register the observer(s) with a {@link FileAlterationMonitor} or run manually.</li>
45
47
* </ul>
46
48
* <h2>Basic Usage</h2> Create a {@link FileAlterationObserver} for the directory and register the listeners:
49
+
*
47
50
* <pre>
48
51
* File directory = new File(FileUtils.current(), "src");
49
52
* FileAlterationObserver observer = new FileAlterationObserver(directory);
@@ -53,6 +56,7 @@
53
56
* <p>
54
57
* To manually observe a directory, initialize the observer and invoked the {@link #checkAndNotify()} method as required:
55
58
* </p>
59
+
*
56
60
* <pre>
57
61
* // initialize
58
62
* observer.init();
@@ -68,6 +72,7 @@
68
72
* <p>
69
73
* Alternatively, register the observer(s) with a {@link FileAlterationMonitor}, which creates a new thread, invoking the observer at the specified interval:
70
74
* </p>
75
+
*
71
76
* <pre>
72
77
* long interval = ...
73
78
* FileAlterationMonitor monitor = new FileAlterationMonitor(interval);
@@ -76,6 +81,7 @@
76
81
* ...
77
82
* monitor.stop();
78
83
* </pre>
84
+
*
79
85
* <h2>File Filters</h2> This implementation can monitor portions of the file system by using {@link FileFilter}s to observe only the files and/or directories
80
86
* that are of interest. This makes it more efficient and reduces the noise from <em>unwanted</em> file system events.
81
87
* <p>
@@ -86,6 +92,7 @@
86
92
* For example, to only observe 1) visible directories and 2) files with a ".java" suffix in a root directory called "src" you could set up a
87
93
* {@link FileAlterationObserver} in the following way:
88
94
* </p>
95
+
*
89
96
* <pre>
90
97
* // Create a FileFilter
91
98
* IOFileFilter directories = FileFilterUtils.and(
@@ -101,12 +108,12 @@
101
108
* observer.addListener(...);
102
109
* observer.addListener(...);
103
110
* </pre>
111
+
*
104
112
* <h2>FileEntry</h2>
105
113
* <p>
106
-
* {@link FileEntry} represents the state of a file or directory, capturing {@link File} attributes at a point in time. Custom
107
-
* implementations of {@link FileEntry} can be used to capture additional properties that the basic implementation does not support. The
108
-
* {@link FileEntry#refresh(File)} method is used to determine if a file or directory has changed since the last check and stores the current state of the
109
-
* {@link File}'s properties.
114
+
* {@link FileEntry} represents the state of a file or directory, capturing {@link File} attributes at a point in time. Custom implementations of
115
+
* {@link FileEntry} can be used to capture additional properties that the basic implementation does not support. The {@link FileEntry#refresh(File)} method is
116
+
* used to determine if a file or directory has changed since the last check and stores the current state of the {@link File}'s properties.
0 commit comments