class PollingDirectoryWatcher extends AbstractDirectoryWatcher
Implementation of a AbstractDirectoryWatcher that uses polling. This implementation is used where java.nio.WatchService isn't available (pre Java 7).
Modifiers | Name | Description |
---|---|---|
private java.util.Map<java.io.File, java.util.Collection<java.lang.String>> |
directoryToExtensionsMap |
|
private java.util.Map<java.io.File, java.lang.Long> |
directoryWatch |
|
private java.util.Collection<java.lang.String> |
extensions |
|
private java.util.Map<java.io.File, java.lang.Long> |
lastModifiedMap |
Fields inherited from class | Fields |
---|---|
class AbstractDirectoryWatcher |
active, listeners, sleepTime |
Type Params | Return Type | Name and description |
---|---|---|
|
private void |
addExtensions(java.util.Collection<java.lang.String> toAdd) |
|
public void |
addWatchDirectory(java.io.File dir, java.util.List<java.lang.String> fileExtensions) |
|
public void |
addWatchFile(java.io.File fileToWatch) |
|
private void |
cacheFilesForDirectory(java.io.File directory, java.util.Collection<java.lang.String> fileExtensions, boolean fireEvent) |
|
private void |
checkForNewFiles() |
|
private java.lang.String |
removeStartingDotIfPresent(java.lang.String extension) |
|
public void |
run() |
|
private void |
trackDirectoryExtensions(java.io.File dir, java.util.List<java.lang.String> fileExtensions) |
Methods inherited from class | Name |
---|---|
class AbstractDirectoryWatcher |
addListener, addWatchDirectory, addWatchFile, fireOnChange, fireOnNew, getFilenameExtension, isValidDirectoryToMonitor, isValidFileToMonitor, removeListener, setActive, setSleepTime |