Skip to content

Simplified, zero dependency directory watching API for Java

License

Notifications You must be signed in to change notification settings

sourcepulp/treespy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

76 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

treespy

Simplified, zero dependency recursive directory watching API for Java SE 7+

Watch a directory recursively

    TreeSpy spy = SpyFactory.getSpy();
    
    String directory = "/home/wfaithfull"
	
	File home = new File(directory);
	
	spy.watchRecursive(home, (changedFile, eventType) -> {
		System.out.println(String.format("File %s changed", changedFile));
	});

Watch a directory recursively with a glob pattern

	TreeSpy spy = SpyFactory.getSpy();
    
    String directory = "/home/wfaithfull"
	
	File home = new File(directory);
	
	spy.watchRecursive(home, (changedFile, eventType) -> {
		System.out.println(String.format("File %s changed", changedFile));
	}, "glob:*.java", "glob:*.txt");

About

Simplified, zero dependency directory watching API for Java

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages