Package jcifs
Interface SmbWatchHandle
-
- All Superinterfaces:
AutoCloseable
,Callable<List<FileNotifyInformation>>
public interface SmbWatchHandle extends AutoCloseable, Callable<List<FileNotifyInformation>>
Handle for receiving change notifications from an SMB server- Author:
- mbechler
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description List<FileNotifyInformation>
call()
void
close()
List<FileNotifyInformation>
watch()
Get the next set of changes Will block until the server returns a set of changes that match the given filter.
-
-
-
Method Detail
-
watch
List<FileNotifyInformation> watch() throws CIFSException
Get the next set of changes Will block until the server returns a set of changes that match the given filter. The file will be automatically opened if it is not and should be closed withclose()
when no longer needed. Closing the context should cancel a pending notify request, but that does not seem to work reliable in all implementations. Changes in between these calls (as long as the file is open) are buffered by the server, so iteratively calling this method should provide all changes (size of that buffer can be adjusted throughConfiguration.getNotifyBufferSize()
). If the server cannot fulfill the request because the changes did not fit the buffer it will return an empty list of changes.- Returns:
- changes since the last invocation
- Throws:
CIFSException
-
call
List<FileNotifyInformation> call() throws CIFSException
- Specified by:
call
in interfaceCallable<List<FileNotifyInformation>>
- Throws:
CIFSException
- See Also:
Callable.call()
-
close
void close() throws CIFSException
- Specified by:
close
in interfaceAutoCloseable
- Throws:
CIFSException
- See Also:
AutoCloseable.close()
-
-