Skip to content

Commit e997b9c

Browse files
committed
Javadoc.
1 parent b0bf3d9 commit e997b9c

2 files changed

Lines changed: 33 additions & 31 deletions

File tree

src/main/java/org/apache/commons/io/monitor/FileAlterationMonitor.java

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ public final class FileAlterationMonitor implements Runnable {
3636
private volatile boolean running = false;
3737

3838
/**
39-
* Construct a monitor with a default interval of 10 seconds.
39+
* Constructs a monitor with a default interval of 10 seconds.
4040
*/
4141
public FileAlterationMonitor() {
4242
this(10000);
4343
}
4444

4545
/**
46-
* Construct a monitor with the specified interval.
46+
* Constructs a monitor with the specified interval.
4747
*
4848
* @param interval The amount of time in milliseconds to wait between
4949
* checks of the file system
@@ -53,7 +53,7 @@ public FileAlterationMonitor(final long interval) {
5353
}
5454

5555
/**
56-
* Construct a monitor with the specified interval and set of observers.
56+
* Constructs a monitor with the specified interval and set of observers.
5757
*
5858
* @param interval The amount of time in milliseconds to wait between
5959
* checks of the file system
@@ -69,7 +69,7 @@ public FileAlterationMonitor(final long interval, final FileAlterationObserver..
6969
}
7070

7171
/**
72-
* Return the interval.
72+
* Returns the interval.
7373
*
7474
* @return the interval
7575
*/
@@ -78,7 +78,7 @@ public long getInterval() {
7878
}
7979

8080
/**
81-
* Set the thread factory.
81+
* Sets the thread factory.
8282
*
8383
* @param threadFactory the thread factory
8484
*/
@@ -87,7 +87,7 @@ public synchronized void setThreadFactory(final ThreadFactory threadFactory) {
8787
}
8888

8989
/**
90-
* Add a file system observer to this monitor.
90+
* Adds a file system observer to this monitor.
9191
*
9292
* @param observer The file system observer to add
9393
*/
@@ -98,13 +98,14 @@ public void addObserver(final FileAlterationObserver observer) {
9898
}
9999

100100
/**
101-
* Remove a file system observer from this monitor.
101+
* Removes a file system observer from this monitor.
102102
*
103103
* @param observer The file system observer to remove
104104
*/
105105
public void removeObserver(final FileAlterationObserver observer) {
106106
if (observer != null) {
107107
while (observers.remove(observer)) {
108+
// empty
108109
}
109110
}
110111
}
@@ -120,7 +121,7 @@ public Iterable<FileAlterationObserver> getObservers() {
120121
}
121122

122123
/**
123-
* Start monitoring.
124+
* Starts monitoring.
124125
*
125126
* @throws Exception if an error occurs initializing the observer
126127
*/
@@ -141,7 +142,7 @@ public synchronized void start() throws Exception {
141142
}
142143

143144
/**
144-
* Stop monitoring.
145+
* Stops monitoring.
145146
*
146147
* @throws Exception if an error occurs initializing the observer
147148
*/
@@ -150,7 +151,7 @@ public synchronized void stop() throws Exception {
150151
}
151152

152153
/**
153-
* Stop monitoring.
154+
* Stops monitoring.
154155
*
155156
* @param stopInterval the amount of time in milliseconds to wait for the thread to finish.
156157
* A value of zero will wait until the thread is finished (see {@link Thread#join(long)}).
@@ -174,7 +175,7 @@ public synchronized void stop(final long stopInterval) throws Exception {
174175
}
175176

176177
/**
177-
* Run.
178+
* Runs this monitor.
178179
*/
179180
@Override
180181
public void run() {

src/main/java/org/apache/commons/io/monitor/FileAlterationObserver.java

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public class FileAlterationObserver implements Serializable {
128128
private final Comparator<File> comparator;
129129

130130
/**
131-
* Construct an observer for the specified directory.
131+
* Constructs an observer for the specified directory.
132132
*
133133
* @param directoryName the name of the directory to observe
134134
*/
@@ -137,7 +137,7 @@ public FileAlterationObserver(final String directoryName) {
137137
}
138138

139139
/**
140-
* Construct an observer for the specified directory and file filter.
140+
* Constructs an observer for the specified directory and file filter.
141141
*
142142
* @param directoryName the name of the directory to observe
143143
* @param fileFilter The file filter or null if none
@@ -160,7 +160,7 @@ public FileAlterationObserver(final String directoryName, final FileFilter fileF
160160
}
161161

162162
/**
163-
* Construct an observer for the specified directory.
163+
* Constructs an observer for the specified directory.
164164
*
165165
* @param directory the directory to observe
166166
*/
@@ -169,7 +169,7 @@ public FileAlterationObserver(final File directory) {
169169
}
170170

171171
/**
172-
* Construct an observer for the specified directory and file filter.
172+
* Constructs an observer for the specified directory and file filter.
173173
*
174174
* @param directory the directory to observe
175175
* @param fileFilter The file filter or null if none
@@ -179,7 +179,7 @@ public FileAlterationObserver(final File directory, final FileFilter fileFilter)
179179
}
180180

181181
/**
182-
* Construct an observer for the specified directory, file filter and
182+
* Constructs an observer for the specified directory, file filter and
183183
* file comparator.
184184
*
185185
* @param directory the directory to observe
@@ -191,7 +191,7 @@ public FileAlterationObserver(final File directory, final FileFilter fileFilter,
191191
}
192192

193193
/**
194-
* Construct an observer for the specified directory, file filter and
194+
* Constructs an observer for the specified directory, file filter and
195195
* file comparator.
196196
*
197197
* @param rootEntry the root directory to observe
@@ -218,7 +218,7 @@ protected FileAlterationObserver(final FileEntry rootEntry, final FileFilter fil
218218
}
219219

220220
/**
221-
* Return the directory being observed.
221+
* Returns the directory being observed.
222222
*
223223
* @return the directory being observed
224224
*/
@@ -227,7 +227,7 @@ public File getDirectory() {
227227
}
228228

229229
/**
230-
* Return the fileFilter.
230+
* Returns the fileFilter.
231231
*
232232
* @return the fileFilter
233233
* @since 2.1
@@ -237,7 +237,7 @@ public FileFilter getFileFilter() {
237237
}
238238

239239
/**
240-
* Add a file system listener.
240+
* Adds a file system listener.
241241
*
242242
* @param listener The file system listener
243243
*/
@@ -248,13 +248,14 @@ public void addListener(final FileAlterationListener listener) {
248248
}
249249

250250
/**
251-
* Remove a file system listener.
251+
* Removes a file system listener.
252252
*
253253
* @param listener The file system listener
254254
*/
255255
public void removeListener(final FileAlterationListener listener) {
256256
if (listener != null) {
257257
while (listeners.remove(listener)) {
258+
// empty
258259
}
259260
}
260261
}
@@ -269,7 +270,7 @@ public Iterable<FileAlterationListener> getListeners() {
269270
}
270271

271272
/**
272-
* Initialize the observer.
273+
* Initializes the observer.
273274
*
274275
* @throws Exception if an error occurs
275276
*/
@@ -289,7 +290,7 @@ public void destroy() throws Exception {
289290
}
290291

291292
/**
292-
* Check whether the file and its children have been created, modified or deleted.
293+
* Checks whether the file and its children have been created, modified or deleted.
293294
*/
294295
public void checkAndNotify() {
295296

@@ -315,7 +316,7 @@ public void checkAndNotify() {
315316
}
316317

317318
/**
318-
* Compare two file lists for files which have been created, modified or deleted.
319+
* Compares two file lists for files which have been created, modified or deleted.
319320
*
320321
* @param parent The parent entry
321322
* @param previous The original list of files
@@ -348,7 +349,7 @@ private void checkAndNotify(final FileEntry parent, final FileEntry[] previous,
348349
}
349350

350351
/**
351-
* Create a new file entry for the specified file.
352+
* Creates a new file entry for the specified file.
352353
*
353354
* @param parent The parent file entry
354355
* @param file The file to create an entry for
@@ -363,7 +364,7 @@ private FileEntry createFileEntry(final FileEntry parent, final File file) {
363364
}
364365

365366
/**
366-
* List the files
367+
* Lists the files
367368
* @param file The file to list files for
368369
* @param entry the parent entry
369370
* @return The child files
@@ -378,7 +379,7 @@ private FileEntry[] doListFiles(final File file, final FileEntry entry) {
378379
}
379380

380381
/**
381-
* Fire directory/file created events to the registered listeners.
382+
* Fires directory/file created events to the registered listeners.
382383
*
383384
* @param entry The file entry
384385
*/
@@ -397,7 +398,7 @@ private void doCreate(final FileEntry entry) {
397398
}
398399

399400
/**
400-
* Fire directory/file change events to the registered listeners.
401+
* Fires directory/file change events to the registered listeners.
401402
*
402403
* @param entry The previous file system entry
403404
* @param file The current file
@@ -415,7 +416,7 @@ private void doMatch(final FileEntry entry, final File file) {
415416
}
416417

417418
/**
418-
* Fire directory/file delete events to the registered listeners.
419+
* Fires directory/file delete events to the registered listeners.
419420
*
420421
* @param entry The file entry
421422
*/
@@ -430,7 +431,7 @@ private void doDelete(final FileEntry entry) {
430431
}
431432

432433
/**
433-
* List the contents of a directory
434+
* Lists the contents of a directory
434435
*
435436
* @param file The file to list the contents of
436437
* @return the directory contents or a zero length array if
@@ -451,7 +452,7 @@ private File[] listFiles(final File file) {
451452
}
452453

453454
/**
454-
* Provide a String representation of this observer.
455+
* Returns a String representation of this observer.
455456
*
456457
* @return a String representation of this observer
457458
*/

0 commit comments

Comments
 (0)