public class FileWatcher extends WatcherSupport
| Modifier and Type | Class and Description |
|---|---|
class |
FileWatcher.FilteringFileVisitor |
| Constructor and Description |
|---|
FileWatcher() |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy() |
static void |
fail(org.slf4j.Logger logger,
String message)
Throws an invalid argument exception after logging a warning
just in case the stack trace gets gobbled up by application containers
like spring or blueprint, at least the error message will be clearly shown in the log
|
PathMatcher |
getDirMatcher() |
ExecutorService |
getExecutor() |
PathMatcher |
getFileMatcher() |
protected FileSystem |
getFileSystem() |
long |
getLastModified() |
Path |
getRoot() |
WatchService |
getWatcher() |
void |
init() |
protected boolean |
isMatchesFile(Path file) |
boolean |
isWatch() |
void |
setDirMatcher(PathMatcher dirMatcher) |
void |
setDirMatchPattern(String pattern)
Sets the directory matching pattern using the
java 7 pattern matching syntax
such as
glob:/foo/* |
void |
setExecutor(ExecutorService executor) |
void |
setFileMatcher(PathMatcher fileMatcher) |
void |
setFileMatchPattern(String pattern)
Sets the file matching pattern using the
java 7 pattern matching syntax
such as
glob:*.xml |
void |
setRoot(Path root) |
void |
setRootDirectory(File directory) |
void |
setRootPath(String rootPath) |
void |
setWatch(boolean watch) |
void |
setWatcher(WatchService watcher) |
addListener, fireListeners, getListeners, getProcessor, removeListener, setProcessorpublic void init()
throws IOException
IOExceptionpublic void destroy()
public long getLastModified()
public void setRootPath(String rootPath)
public void setRootDirectory(File directory)
public void setDirMatchPattern(String pattern)
glob:/foo/*public void setFileMatchPattern(String pattern)
glob:*.xmlpublic Path getRoot()
public void setRoot(Path root)
public boolean isWatch()
public void setWatch(boolean watch)
public WatchService getWatcher()
public void setWatcher(WatchService watcher)
public PathMatcher getDirMatcher()
public void setDirMatcher(PathMatcher dirMatcher)
public PathMatcher getFileMatcher()
public void setFileMatcher(PathMatcher fileMatcher)
public ExecutorService getExecutor()
public void setExecutor(ExecutorService executor)
protected boolean isMatchesFile(Path file)
protected FileSystem getFileSystem()
public static void fail(org.slf4j.Logger logger,
String message)
Copyright © 2011–2014 Red Hat. All rights reserved.