public class ModifiableFileWatcher extends AbstractLoggingBean
| Modifier and Type | Field and Description |
|---|---|
protected LinkOption[] |
options |
log| Constructor and Description |
|---|
ModifiableFileWatcher(File file) |
ModifiableFileWatcher(Path file) |
ModifiableFileWatcher(Path file,
LinkOption... options) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkReloadRequired() |
boolean |
exists() |
Path |
getPath() |
FileTime |
lastModified() |
void |
resetReloadAttributes()
Resets the state attributes used to detect changes to the initial
construction values - i.e., file assumed not to exist and no known
size of modify time
|
long |
size() |
void |
updateReloadAttributes()
May be called to refresh the state attributes used to detect changes
e.g., file existence, size and last-modified time once re-loading is
successfully completed.
|
protected final LinkOption[] options
public ModifiableFileWatcher(File file)
public ModifiableFileWatcher(Path file)
public ModifiableFileWatcher(Path file, LinkOption... options)
public final boolean exists()
throws IOException
IOExceptionpublic final long size()
throws IOException
IOExceptionpublic final FileTime lastModified() throws IOException
IOExceptionpublic boolean checkReloadRequired()
throws IOException
true if the watched file has probably been changedIOException - If failed to query file datapublic void resetReloadAttributes()
public void updateReloadAttributes()
throws IOException
IOException - If failed to access the file (if exists)resetReloadAttributes()Copyright © 2008–2015 The Apache Software Foundation. All rights reserved.