// Ensure existing monitoring requests don't overlap with this new
// request;
// amend existing requests or ignore new request as appropriate
if (request instanceof DirectoryMonitoringRequest) {
final DirectoryMonitoringRequest dmr = (DirectoryMonitoringRequest) request;
if (dmr.isWatchSubtree()) {
for (final MonitoringRequest existing : requests) {
if (existing instanceof DirectoryMonitoringRequest) {
final DirectoryMonitoringRequest existingDmr = (DirectoryMonitoringRequest) existing;
if (existingDmr.isWatchSubtree()) {
// We have a new request and an existing
// request, both for directories, and both which
// monitor sub-trees
String existingDmrPath;
String newDmrPath;
try {
existingDmrPath = existingDmr.getFile()
.getCanonicalPath();
newDmrPath = dmr.getFile()
.getCanonicalPath();
}
catch (final IOException ioe) {