Crossfire JXClient, Trunk
WatchDir Class Reference
+ Collaboration diagram for WatchDir:

Static Public Member Functions

static void main (String[] args) throws IOException
 

Private Member Functions

void register (Path dir) throws IOException
 
void registerAll (final Path start) throws IOException
 

Private Attributes

int count
 
final boolean recursive
 
boolean trace = false
 
final WatchService watcher
 

Detailed Description

Example to watch a directory (or tree) for changes to files.

Definition at line 51 of file WatchDir.java.

Member Function Documentation

◆ main()

static void WatchDir.main ( String[]  args) throws IOException
static

Definition at line 168 of file WatchDir.java.

References recursive.

◆ register()

void WatchDir.register ( Path  dir) throws IOException
private

Register the given directory with the WatchService

Definition at line 66 of file WatchDir.java.

References count, trace, and watcher.

◆ registerAll()

void WatchDir.registerAll ( final Path  start) throws IOException
private

Register the given directory, and all its sub-directories, with the WatchService.

Definition at line 77 of file WatchDir.java.

Member Data Documentation

◆ count

int WatchDir.count
private

Definition at line 56 of file WatchDir.java.

Referenced by register().

◆ recursive

final boolean WatchDir.recursive
private

Definition at line 54 of file WatchDir.java.

Referenced by main().

◆ trace

boolean WatchDir.trace = false
private

Definition at line 55 of file WatchDir.java.

Referenced by register().

◆ watcher

final WatchService WatchDir.watcher
private

Definition at line 53 of file WatchDir.java.

Referenced by register().


The documentation for this class was generated from the following file: