Example usage for org.apache.commons.jci.monitor FilesystemAlterationMonitor start

List of usage examples for org.apache.commons.jci.monitor FilesystemAlterationMonitor start

Introduction

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

Prototype

public void start() 

Source Link

Usage

From source file:nz.net.catalyst.mobile.dds.WurflCapabilityServiceImpl.java

/**
 * create listeners and monitors for wurfl and its patches
 *///from   www .j a va2 s.co m
protected synchronized void startWatchingFiles() {
    famList.clear();

    FilesystemAlterationMonitor fam = new FilesystemAlterationMonitor();
    FileChangeListener wurflListener = new WurflFileListener();
    fam.addListener(wurflFile, wurflListener);
    fam.start();
    famList.add(fam);
    logger.debug("watching " + wurflFile.getAbsolutePath());

    for (File patchFile : wurflPatchFiles) {
        fam = new FilesystemAlterationMonitor();
        FileChangeListener wurflPatchListener = new WurflFileListener();
        fam.addListener(patchFile, wurflPatchListener);
        fam.start();
        famList.add(fam);
        logger.debug("watching " + patchFile.getAbsolutePath());
    }

}

From source file:org.openecard.addon.FileRegistry.java

private void startFileMonitor(String addonPath) throws WSMarshallerException {
    File f = new File(addonPath);
    logger.debug("Starting file alteration monitor on path: {}", f.getPath());
    FilesystemAlterationMonitor fam = new FilesystemAlterationMonitor();
    fam.addListener(f, new PluginDirectoryAlterationListener(this));
    fam.start();
}