File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes File Watcher utility scheduling Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "File Watcher utility scheduling " Watch "File Watcher utility scheduling " New topic
Author

File Watcher utility scheduling

Udayan Kumar
Ranch Hand

Joined: Jan 16, 2007
Posts: 66
All,

I am planning to implement a file watcher utility similar to one as mentioned in this link
http://download.oracle.com/javase/tutorial/essential/io/notification.html

My question is related to options in the java space on how do I keep this utility up and running all the time to listen to the file change events.
Should I create it as a web component and deploy it in a web/application server or resort to creating a java program configured to run in OS level scheduler.

Do post your thoughts on how to go about the scheduling aspect for this utility.

Thanks,
Jesper de Jong
Java Cowboy
Bartender

Joined: Aug 16, 2005
Posts: 11642

You can just run a Java program and leave it running; there's no need to make it run in a Java EE application server. If you want your program to be started whenever the computer starts, then you'd need to do that using some operating specific method to start programs at startup. Which operating system are you using?

Note that the APIs that are used in that tutorial are new in Java 7, which is not officially released yet. You can't use things like WatchService in Java 6 or older.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Otto Takacs
Greenhorn

Joined: Feb 09, 2012
Posts: 1
If you want to implement the same but using java before 7 just visit the followinv site:
http://jpathwatch.wordpress.com/
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 26716
That looks a useful application. and welcome to the Ranch
 
 
subject: File Watcher utility scheduling
 
Threads others viewed
doubt on run method
File Upload
Calling web application from File Watcher(Autosys)
setting up file watcher job with autosys
how Scheduling Jobs in a Java Web Application
developer file tools