Package: org.grails.io.watch

## [Java] Class MacOsWatchServiceDirectoryWatcher

- org.grails.io.watch.MacOsWatchServiceDirectoryWatcher

-     class MacOsWatchServiceDirectoryWatcher
      extends AbstractDirectoryWatcher

  Implementation of a AbstractDirectoryWatcher that uses java.nio.WatchService. This implementation is used for Java 7 and later.

  Authors:
    Eric Helgeson
    David Estes
  Since:
    3.2
  See Also:
    DirectoryWatcher

- - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `private static org.slf4j.Logger` | `LOG` |
    `private java.util.Set<java.nio.file.Path>` | `individualWatchedFiles` |
    `private java.util.Map<java.nio.file.WatchKey, java.util.List<java.lang.String>>` | `watchKeyToExtensionsMap` |
    `private java.nio.file.WatchService` | `watchService` |

  - Inherited fields
    Fields inherited from class | Fields
    --- | ---
    `class AbstractDirectoryWatcher` | `active, listeners, sleepTime`

  - ### Constructor Summary

    Constructors
    Constructor and description
    `MacOsWatchServiceDirectoryWatcher ()`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public void` | `addWatchDirectory(java.io.File dir, java.util.List<java.lang.String> fileExtensions)`
    `` | `private void` | `addWatchDirectory(java.nio.file.Path dir, java.util.List<java.lang.String> fileExtensions)`
    `` | `public void` | `addWatchFile(java.io.File fileToWatch)`
    `<T>` | `private static java.nio.file.WatchEvent<T>` | `cast(java.nio.file.WatchEvent<?> event)`
    `` | `public java.nio.file.FileVisitResult` | `preVisitDirectory(java.nio.file.Path dir, java.nio.file.attribute.BasicFileAttributes attrs)`
    `` | `public void` | `run()`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class AbstractDirectoryWatcher` | `addListener, addWatchDirectory, addWatchFile, fireOnChange, fireOnNew, getFilenameExtension, isValidDirectoryToMonitor, isValidFileToMonitor, removeListener, setActive, setSleepTime`

- - ### Field Detail

    - #### private static final org.slf4j.Logger LOG

    - #### private java.util.Set<java.nio.file.Path> individualWatchedFiles

    - #### private java.util.Map<java.nio.file.WatchKey, java.util.List<java.lang.String>> watchKeyToExtensionsMap

    - #### private final java.nio.file.WatchService watchService

  - ### Constructor Detail

    - #### public MacOsWatchServiceDirectoryWatcher()

  - ### Method Detail

    - #### @java.lang.Override public void addWatchDirectory(java.io.File dir, java.util.List<java.lang.String> fileExtensions)

    - #### private void addWatchDirectory(java.nio.file.Path dir, java.util.List<java.lang.String> fileExtensions)

    - #### @java.lang.Override public void addWatchFile(java.io.File fileToWatch)

    - #### <T> @java.lang.SuppressWarnings("unchecked") private static java.nio.file.WatchEvent<T> cast(java.nio.file.WatchEvent<?> event)

    - #### @java.lang.Override public java.nio.file.FileVisitResult preVisitDirectory(java.nio.file.Path dir, java.nio.file.attribute.BasicFileAttributes attrs)

    - #### @java.lang.Override public void run()