Pages

Monday, April 2, 2012

Java 7 Utility programs for watching directories and finding strings


I have just pushed two very useful java programs/utilities that we have used in the past month for debugging file issues and searching for certain string patterns recursively in a directory.

https://github.com/kelapure/general-java-utils/blob/master/filewatcher/StringFinder.java
This program finds strings of an input  pattern recursively through a specified list of pattern matched directories.
Sort of like a java grep. We used this program to find untranslated messages that should have been internationalized.

https://github.com/kelapure/general-java-utils/blob/master/filewatcher/WatchDir.java
This  program will let you know if a particular directory is being written too. If any file in the directory is created, modified delated. This is very useful when you have to watch a particular directory structure for any changes.

Both these programs make extensive use of Java7  java.nio.file APIs for listing directories, files and for monitoring directories. Please modify and use for your needs.


No comments:

Post a Comment

Note: Only a member of this blog may post a comment.