Example usage for org.apache.commons.jci.monitor FilesystemAlterationObserverImpl FilesystemAlterationObserverImpl

List of usage examples for org.apache.commons.jci.monitor FilesystemAlterationObserverImpl FilesystemAlterationObserverImpl

Introduction

In this page you can find the example usage for org.apache.commons.jci.monitor FilesystemAlterationObserverImpl FilesystemAlterationObserverImpl.

Prototype

public FilesystemAlterationObserverImpl(final File pRootDirectory) 

Source Link

Usage

From source file:org.apache.accumulo.start.classloader.AccumuloFilesystemAlterationMonitor.java

public void addListener(final File pRoot, final FilesystemAlterationListener pListener) {

    FilesystemAlterationObserver observer;

    synchronized (observersLock) {
        observer = (FilesystemAlterationObserver) observers.get(pRoot);

        if (observer == null) {
            final Map newObservers = new HashMap(observers);
            observer = new FilesystemAlterationObserverImpl(pRoot);
            newObservers.put(pRoot, observer);
            observers = Collections.unmodifiableMap(newObservers);
        }/*from   w  w  w.jav  a  2s.co m*/
    }

    observer.addListener(pListener);
}