org.apache.avalon.excalibur.monitor
Class DirectoryResource
java.lang.Object
org.apache.avalon.excalibur.monitor.Resource
org.apache.avalon.excalibur.monitor.DirectoryResource
- All Implemented Interfaces:
- Modifiable
public class DirectoryResource
- extends Resource
This is a Resource that monitors a directory. If any files
are added, removed or modified in directory then it will
send an event indicating the change.
- Version:
- $Revision: 1.5 $ $Date: 2004/02/28 11:47:32 $
- Author:
- Avalon Development Team
Field Summary |
static java.lang.String |
ADDED
|
private java.io.File |
m_dir
|
private java.util.Set |
m_files
|
private java.util.Map |
m_times
|
static java.lang.String |
MODIFIED
|
static java.lang.String |
REMOVED
|
Method Summary |
long |
lastModified()
The time this was last modified. |
void |
testModifiedAfter(long time)
Test whether this has been modified since time X |
Methods inherited from class org.apache.avalon.excalibur.monitor.Resource |
addPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListenersFrom, fireAndSetModifiedTime, getEventSupport, getPreviousModified, getResourceKey, hasListeners, hasListeners, removeAllPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener, setPreviousModified, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ADDED
public static final java.lang.String ADDED
- See Also:
- Constant Field Values
REMOVED
public static final java.lang.String REMOVED
- See Also:
- Constant Field Values
MODIFIED
public static final java.lang.String MODIFIED
- See Also:
- Constant Field Values
m_dir
private final java.io.File m_dir
m_files
private java.util.Set m_files
m_times
private java.util.Map m_times
DirectoryResource
public DirectoryResource(java.lang.String resourceKey)
throws java.lang.Exception
- Throws:
java.lang.Exception
testModifiedAfter
public void testModifiedAfter(long time)
- Test whether this has been modified since time X
- Specified by:
testModifiedAfter
in interface Modifiable
- Overrides:
testModifiedAfter
in class Resource
lastModified
public long lastModified()
- Description copied from class:
Resource
- The time this was last modified.
- Specified by:
lastModified
in interface Modifiable
- Specified by:
lastModified
in class Resource