com.emarsys.ecommon.files
Class FileMonitor

java.lang.Object
  extended by com.emarsys.ecommon.files.FileMonitor

public class FileMonitor
extends java.lang.Object

FileMonitor checks files in a given intervall for changement. A FileMonitor.FileChangeListener has to be provided to do this job. (excluded from e3)

Author:
unknown
See Also:
FileMonitor.FileChangeListener

Nested Class Summary
static interface FileMonitor.FileChangeListener
          (excluded from e3)
 
Constructor Summary
protected FileMonitor()
           
 
Method Summary
 void addFileChangeListener(FileMonitor.FileChangeListener listener)
          Add a monitored file with a FileChangeListener.
protected  void fireFileChangeEvent(FileMonitor.FileChangeListener listener)
           
static FileMonitor getInstance()
           
 void removeFileChangeListener(FileMonitor.FileChangeListener listener, java.lang.String fileName)
          Remove the listener from the notification list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileMonitor

protected FileMonitor()
Method Detail

getInstance

public static FileMonitor getInstance()

addFileChangeListener

public void addFileChangeListener(FileMonitor.FileChangeListener listener)
                           throws java.io.FileNotFoundException
Add a monitored file with a FileChangeListener.

Parameters:
listener - listener to notify when the file changed.
fileName - name of the file to monitor.
period - polling period in milliseconds.
Throws:
java.io.FileNotFoundException

removeFileChangeListener

public void removeFileChangeListener(FileMonitor.FileChangeListener listener,
                                     java.lang.String fileName)
Remove the listener from the notification list.

Parameters:
listener - the listener to be removed.

fireFileChangeEvent

protected void fireFileChangeEvent(FileMonitor.FileChangeListener listener)


Copyright © 2010 emarsys AG. All Rights Reserved.