Enum WatchEvent.Kind

    • Enum Constant Detail

      • CREATED

        public static final WatchEvent.Kind CREATED
        A path entry was created. Be careful not to assume that when the event arrives, the path still exists.
      • MODIFIED

        public static final WatchEvent.Kind MODIFIED
        The path entry was saved. It is platform specific if this relates to flushes or other events. a single user action can generate multiple of these events.
      • DELETED

        public static final WatchEvent.Kind DELETED
        The path entry was deleted. Note that if the path entry was the watched item (aka the root of the watch), there is no guarantee if you will receive this event (depending on the level and on the platform). The watch will be invalid after that, even if a new item is created afterwards with the same name. In some cases this can be fixed/detected by also watching the parent, but that is only valid if they are on the same mountpoint.
      • OVERFLOW

        public static final WatchEvent.Kind OVERFLOW
        Rare event where there were so many file events, that the kernel lost a few. In that case you'll have to consider the whole directory (and its sub directories) as modified. The library will try and send events for new and deleted files, but it won't be able to detect modified files.
    • Method Detail

      • values

        public static WatchEvent.Kind[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (WatchEvent.Kind c : WatchEvent.Kind.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static WatchEvent.Kind valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null