public class VFSFileHandlerReloadingDetector extends FileHandlerReloadingDetector
A file-based reloading strategy that uses Commons VFS to determine when a file was changed.
This reloading strategy is very similar to
FileHandlerReloadingDetector, except for the fact that it uses VFS
and thus can deal with a variety of different configuration sources.
This strategy only works with FileConfiguration instances.
| Constructor and Description |
|---|
VFSFileHandlerReloadingDetector()
Creates a new instance of
VFSFileHandlerReloadingDetector and
initializes it with an empty FileHandler object. |
VFSFileHandlerReloadingDetector(FileHandler handler)
Creates a new instance of
VFSFileHandlerReloadingDetector and
initializes it with the given FileHandler object. |
VFSFileHandlerReloadingDetector(FileHandler handler,
long refreshDelay)
Creates a new instance of
VFSFileHandlerReloadingDetector and
initializes it with the given FileHandler object and the given
refresh delay. |
| Modifier and Type | Method and Description |
|---|---|
protected org.apache.commons.vfs2.FileObject |
getFileObject()
Returns the file that is monitored by this strategy.
|
protected long |
getLastModificationDate()
Returns the date of the last modification of the monitored file.
|
protected String |
resolveFileURI()
Resolves the URI of the monitored file.
|
getFile, getFileHandler, getRefreshDelay, isReloadingRequired, refresh, reloadingPerformed, updateLastModifiedpublic VFSFileHandlerReloadingDetector()
VFSFileHandlerReloadingDetector and
initializes it with an empty FileHandler object.public VFSFileHandlerReloadingDetector(FileHandler handler, long refreshDelay)
VFSFileHandlerReloadingDetector and
initializes it with the given FileHandler object and the given
refresh delay.handler - the FileHandlerrefreshDelay - the refresh delaypublic VFSFileHandlerReloadingDetector(FileHandler handler)
VFSFileHandlerReloadingDetector and
initializes it with the given FileHandler object.handler - the FileHandlerprotected long getLastModificationDate()
FileObject and read the date of the last modification.getLastModificationDate in class FileHandlerReloadingDetectorprotected org.apache.commons.vfs2.FileObject getFileObject()
protected String resolveFileURI()
Copyright © 2001–2020 The Apache Software Foundation. All rights reserved.