public abstract class Watcher
extends java.lang.Object
implements java.io.Closeable
Modifier and Type | Class and Description |
---|---|
class |
Watcher.FilteringFileVisitor |
Constructor and Description |
---|
Watcher() |
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected abstract void |
debug(java.lang.String message,
java.lang.Object... args) |
void |
fail(java.lang.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
|
java.nio.file.PathMatcher |
getDirMatcher() |
java.nio.file.PathMatcher |
getFileMatcher() |
protected java.nio.file.FileSystem |
getFileSystem() |
long |
getLastModified() |
java.nio.file.Path |
getRoot() |
java.nio.file.WatchService |
getWatcher() |
void |
init() |
protected boolean |
isMatchesFile(java.nio.file.Path file) |
boolean |
isWatch() |
protected abstract void |
onRemove(java.nio.file.Path path) |
protected abstract void |
process(java.nio.file.Path path) |
void |
processEvents() |
void |
rescan() |
void |
setDirMatcher(java.nio.file.PathMatcher dirMatcher) |
void |
setFileMatcher(java.nio.file.PathMatcher fileMatcher) |
void |
setRoot(java.nio.file.Path root) |
void |
setRootDirectory(java.io.File directory) |
void |
setRootPath(java.lang.String rootPath) |
void |
setWatch(boolean watch) |
void |
setWatcher(java.nio.file.WatchService watcher) |
protected abstract void |
warn(java.lang.String message,
java.lang.Object... args) |
public void init() throws java.io.IOException
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException
public long getLastModified()
public void setRootPath(java.lang.String rootPath)
public void setRootDirectory(java.io.File directory)
public java.nio.file.Path getRoot()
public void setRoot(java.nio.file.Path root)
public boolean isWatch()
public void setWatch(boolean watch)
public java.nio.file.WatchService getWatcher()
public void setWatcher(java.nio.file.WatchService watcher)
public java.nio.file.PathMatcher getDirMatcher()
public void setDirMatcher(java.nio.file.PathMatcher dirMatcher)
public java.nio.file.PathMatcher getFileMatcher()
public void setFileMatcher(java.nio.file.PathMatcher fileMatcher)
public void rescan() throws java.io.IOException
java.io.IOException
public void processEvents()
protected boolean isMatchesFile(java.nio.file.Path file)
protected java.nio.file.FileSystem getFileSystem()
public void fail(java.lang.String message)
protected abstract void debug(java.lang.String message, java.lang.Object... args)
protected abstract void warn(java.lang.String message, java.lang.Object... args)
protected abstract void process(java.nio.file.Path path)
protected abstract void onRemove(java.nio.file.Path path)
Copyright © 2006-2014 The Apache Software Foundation. All Rights Reserved.