1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.commons.jci.listeners;
19
20 import java.io.File;
21
22 import org.apache.commons.jci.monitor.FilesystemAlterationObserver;
23
24
25
26
27
28
29 public class FileChangeListener extends AbstractFilesystemAlterationListener {
30
31 private boolean changed;
32
33 public boolean hasChanged() {
34 return changed;
35 }
36
37 public void onStart( final FilesystemAlterationObserver pObserver ) {
38 changed = false;
39 super.onStart(pObserver);
40 }
41
42 public void onStop( final FilesystemAlterationObserver pObserver ) {
43 super.onStop(pObserver);
44 }
45
46
47 public void onFileChange( final File pFile ) {
48 changed = true;
49 }
50
51
52 public void onFileCreate( final File pFile ) {
53 changed = true;
54 }
55
56
57 public void onFileDelete( final File pFile ) {
58 changed = true;
59 }
60
61
62 public void onDirectoryChange( final File pDir ) {
63 }
64
65 public void onDirectoryCreate( final File pDir ) {
66 }
67
68 public void onDirectoryDelete( final File pDir ) {
69 }
70
71 }