Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

constant lookup for folder changes  RSS feed

 
vijay shanker
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends;

i am asked to Watch a specified folder(example c:/adc) for new folders added.

how should i do this. any head start.
 
Rob Spoor
Sheriff
Posts: 20893
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) Use Apache Commons I/O. It has a file monitor class.

2) Wait until Java 7 comes out. It too has a file monitor class.

3) Write your own scheduled job, using a Timer, ScheduledExecutor, Quartz or something similar.

Of course, 1 would be the easiest for a short term solution. In the Java in General forum there was a thread about this too, and after quite some work I managed to figure out (and post) how to use it for java.io.File.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!