How to make FileAlterationObserver
to observe a remote directory?
This can accept a String
path or a Java File
. Both the cases it will look for the directory in local context. I have a directory in remote server file system.
It would be also helpful if anyone tell me how to create a new File
object referring to the file in the remote directory.
Example:
File file = new File("remote directory path");
You cannot.
File
object cannot refer to an SFTP file.All you can do is to use JSch (or other) SFTP interface to check for changes in regular intervals yourself.