public interface FileMonitor
The properties associated with the registered service specify what resources are monitored and with what frequency. Valid service properties are listed as constants below with descriptive javadoc.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
MONITOR_DIRECTORIES
Service property
|
static java.lang.String |
MONITOR_FILES
Service property
|
static java.lang.String |
MONITOR_FILTER
Service property
|
static java.lang.String |
MONITOR_FILTER_DIRECTORIES_ONLY
Property value
|
static java.lang.String |
MONITOR_FILTER_FILES_ONLY
Property value
|
static java.lang.String |
MONITOR_INCLUDE_SELF
Service property
|
static java.lang.String |
MONITOR_INTERVAL
Service property
|
static java.lang.String |
MONITOR_RECURSE
Service property
|
static java.lang.String |
MONITOR_TYPE
Service property
|
static java.lang.String |
MONITOR_TYPE_EXTERNAL
Property value
|
static java.lang.String |
MONITOR_TYPE_TIMED
Property value
|
Modifier and Type | Method and Description |
---|---|
void |
onBaseline(java.util.Collection<java.io.File> baseline)
Called with the result of a scan of specified resources.
|
void |
onChange(java.util.Collection<java.io.File> createdFiles,
java.util.Collection<java.io.File> modifiedFiles,
java.util.Collection<java.io.File> deletedFiles)
Called by the monitor service when a scheduled scan completes with
changes (indicated by the presence of files in the corresponding collection).
|
static final java.lang.String MONITOR_FILES
static final java.lang.String MONITOR_DIRECTORIES
static final java.lang.String MONITOR_INTERVAL
static final java.lang.String MONITOR_RECURSE
For example, given monitored directory A:
static final java.lang.String MONITOR_INCLUDE_SELF
For example, given monitored directory A:
static final java.lang.String MONITOR_FILTER
This applies only to monitoring directories. Given monitored directory A:
static final java.lang.String MONITOR_FILTER_DIRECTORIES_ONLY
MONITOR_FILTER
,
Constant Field Valuesstatic final java.lang.String MONITOR_FILTER_FILES_ONLY
MONITOR_FILTER
,
Constant Field Valuesstatic final java.lang.String MONITOR_TYPE
static final java.lang.String MONITOR_TYPE_TIMED
static final java.lang.String MONITOR_TYPE_EXTERNAL
void onBaseline(java.util.Collection<java.io.File> baseline)
baseline
- Collection of files which match the
specified filters that were discovered during the scan.#MONITOR_BASELINE
void onChange(java.util.Collection<java.io.File> createdFiles, java.util.Collection<java.io.File> modifiedFiles, java.util.Collection<java.io.File> deletedFiles)
createdFiles
- A collection of files that were created since the last scan.modifiedFiles
- A collection of files that were modified since the last scan.deletedFiles
- A collection of files that were deleted since the last scan.