Class WatchServiceListener.Builder

    • Method Detail

      • threadFactory

        public WatchServiceListener.Builder threadFactory​(java.util.concurrent.ThreadFactory factory)
        Set the thread factory that will be used to create the polling thread for the returned watch service.
        Parameters:
        factory - the thread factory to use to create the deamon thread
        Returns:
        this builder
        Since:
        4.0.0
      • taskExecutor

        public WatchServiceListener.Builder taskExecutor​(java.util.concurrent.Executor executor)
        Set the executor that will be used to execute tasks queued based on received events. By default, the common pool is used.
        Parameters:
        executor - the executor to use
        Returns:
        this builder
        Since:
        4.0.0
      • fileSystem

        public WatchServiceListener.Builder fileSystem​(java.nio.file.FileSystem system)
        Set the filesystem expected to be used for paths. A separate WatchServiceListener should be created to listen to events on each different file system.
        Parameters:
        system - the file system to use.
        Returns:
        this builder
        Since:
        4.0.0
      • build

        public WatchServiceListener build()
                                   throws java.io.IOException
        Create a new listener, using default values for any unset parameters.
        Returns:
        a newly created executor
        Throws:
        java.io.IOException - if thrown by WatchServiceListener's constructor
        Since:
        4.0.0