用于监视文本文件更改的Java代码 [英] Java Code to monitor changes in a text file

查看:135
本文介绍了用于监视文本文件更改的Java代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要编写一个java代码来检测对文本文件所做的更改,并且还会在文本文件更改时通知对文本文件所做的更改(例如)如果在文本文件中将单词ABCD更改为BCDA,则我需要通知ABCD已更改为BCDA。你能否告诉我是否可以使用java实现这一点(仅使用开源,无付费或商业工具)

I need to write a java code which detects changes done to a text file and also notify what change was done to the text file when the text file is changed ie) If a word ABCD was changed to BCDA in the text file then i need to be notified that ABCD was changed to BCDA. Can you please let me know whether i can achieve this using java(using only opensource and no paid or commercial tools)

推荐答案

更标准的解决方案,您还可以查看 JSR 203 backport for Java 6 。它提供了File Scanner功能,与即将推出的Java运行时兼容。

For a more standard solution, you can also take a look at JSR 203 backport for Java 6. it provides File Scanner facility, compatible with upcoming Java runtime.

这篇关于用于监视文本文件更改的Java代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆