`
kylinsoong
  • 浏览: 240163 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Customized Utility 1: FileChangeMonitor

阅读更多

      When we are in software developing we usually need to do some very simple things manually, for instance, we offen need to check the files under a directory is added or deleted. especially when your software come to test peroid, that means you have to install and uninstall your software many times, and every time your want to know which file has been added or which has been deleted, and for this requirement, this piece's Customized Utility Came out, the following is more detailed depicted:

 

Functionality:

      FileChangeMonitor can help you monitor the files change under a defined folder, and record the monitor result to a defined file, and also can output the monitor result to console if you would.  this utility is pretty useful when install some plugin software base on underlying software, in this occation, if you define your monitor the underlying software before you intall your plugin software, and then FileChangeMonitor will help you record what you had done, this pretty cool to a software developer.

      FileChangeMonitor.xml has been supplyed for you to define the folder need to monitor, the result saved file and whether need to output to console or not, as following:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
	<entry key="monitor.folder">D:\dev-test\home</entry>
	<entry key="hander.file">test.log</entry>
	<entry key="hander.console">true</entry>
</properties>

             monitor.folder: use to define the folder need to monitor

             hander.file: the name of result record file name

             hander.console: whether need to output to console or not(only 'true' or 'false' are allowed)

 

Utility Consists:

      FileChangeMonitor consists of Three part:

      1. Runnable lib folder(contain all jar files);

      2. Configuration file(FileChangeMonitor.xml) ;

      3. Executable script file both Windows and Linux(run.cmd and run.sh).

the figure below has a detailed instrcution.



 

How to Use?

      FileChangeMonitor is very easy to use, i will give a Step by Step pictured demonstration:

      1. Use a file editor tool to editor FileChangeMonitor.xml to define a folder to monitor, the file name to save record monitor result, whether need to output to console, the belows show the monitored folder is "D:\dev-test\home", the result will be saved to "record.log" file and need to output to console.

 

      

      2. Start a command line, navigate to FileChangeMonitor folder and execute 'run.cmd' if you are in Windows system;

      

      3. Do some change in monitored folder and check the result

 Output in console:

record.log will be found in FileChangeMonitor root, and open the file you will find the same info:

 

      4. Use Ctrl + C can terminate the FileChangeMonitor;

 

Supplement Claims:

      1. The FileChangeMonitor do not support monitor a folder which own millions of files;

      2. The FileChangeMonitor do not suppport to delete and add the same file very frequently.

 

Ending

      The attached file 'FileChangeMonitor.rar' contain both FileChangeMonitor utility and src code.  

 

  • 大小: 8.8 KB
  • 大小: 7.5 KB
  • 大小: 5.4 KB
  • 大小: 6.4 KB
  • 大小: 9 KB
  • 大小: 1.8 KB
1
0
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics