Class VFSFileHandlerReloadingDetector

    • Constructor Detail

      • VFSFileHandlerReloadingDetector

        public VFSFileHandlerReloadingDetector()
        Creates a new instance of VFSFileHandlerReloadingDetector and initializes it with an empty FileHandler object.
      • VFSFileHandlerReloadingDetector

        public VFSFileHandlerReloadingDetector​(FileHandler handler,
                                               long refreshDelay)
        Creates a new instance of VFSFileHandlerReloadingDetector and initializes it with the given FileHandler object and the given refresh delay.
        Parameters:
        handler - the FileHandler
        refreshDelay - the refresh delay
      • VFSFileHandlerReloadingDetector

        public VFSFileHandlerReloadingDetector​(FileHandler handler)
        Creates a new instance of VFSFileHandlerReloadingDetector and initializes it with the given FileHandler object.
        Parameters:
        handler - the FileHandler
    • Method Detail

      • getLastModificationDate

        protected long getLastModificationDate()
        Gets the date of the last modification of the monitored file. A return value of 0 indicates, that the monitored file does not exist. This implementation uses Commons VFS to obtain a FileObject and read the date of the last modification.
        Overrides:
        getLastModificationDate in class FileHandlerReloadingDetector
        Returns:
        the last modification date in milliseconds.
      • getFileObject

        protected org.apache.commons.vfs2.FileObject getFileObject()
        Gets the file that is monitored by this strategy. Note that the return value can be null under some circumstances.
        Returns:
        the monitored file
      • resolveFileURI

        protected String resolveFileURI()
        Resolves the URI of the monitored file.
        Returns:
        the URI of the monitored file or null if it cannot be resolved