Package engineering.swat.watch
Enum WatchScope
- java.lang.Object
-
- java.lang.Enum<WatchScope>
-
- engineering.swat.watch.WatchScope
-
- All Implemented Interfaces:
Serializable,Comparable<WatchScope>
public enum WatchScope extends Enum<WatchScope>
Configure the depth of the events you want to receive for a given path
-
-
Enum Constant Summary
Enum Constants Enum Constant Description PATH_AND_ALL_DESCENDANTSWatch changes to (metadata of) a directory and its content, recursively.PATH_AND_CHILDRENWatch changes to (metadata of) a directory and its content, non-recursively.PATH_ONLYWatch changes to a single file or (metadata of) a single directory.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static WatchScopevalueOf(String name)Returns the enum constant of this type with the specified name.static WatchScope[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
PATH_ONLY
public static final WatchScope PATH_ONLY
Watch changes to a single file or (metadata of) a single directory.
Note, depending on the platform you can receive events for a directory in case of these events:
- a MODIFIED caused by the creation of a nested file/directory
- a MODIFIED caused by the deletion of a nested file/directory
- a MODIFIED of its own metadata
In most cases when Path is a Directory you're interested in which nested entries changes, in that case use
PATH_AND_CHILDRENorPATH_AND_ALL_DESCENDANTS.
-
PATH_AND_CHILDREN
public static final WatchScope PATH_AND_CHILDREN
Watch changes to (metadata of) a directory and its content, non-recursively. That is, changes to the content of nested directories are not watched.
-
PATH_AND_ALL_DESCENDANTS
public static final WatchScope PATH_AND_ALL_DESCENDANTS
Watch changes to (metadata of) a directory and its content, recursively. That is, changes to the content of nested directories are also watched.
-
-
Method Detail
-
values
public static WatchScope[] 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 (WatchScope c : WatchScope.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static WatchScope 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 nameNullPointerException- if the argument is null
-
-