aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Dynamically reading the files at runtime Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Dynamically reading the files at runtime" Watch "Dynamically reading the files at runtime" New topic
Author

Dynamically reading the files at runtime

Faraz Ka
Ranch Hand

Joined: Jun 01, 2013
Posts: 44
Hello,

My web Application when gets started reads from a file system for files and does some processing.
Every time the folder gets updated with new files, the web Application needs to be relaunched.

Any clue how to make it dynamic so that when the new file gets added it is picked for processing without a restart?

Thanks,
Faraz
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39548
    
  27
If you're using Java 7 you can use a built-in API: http://docs.oracle.com/javase/tutorial/essential/io/notification.html. Otherwise you will have to write your own task that scans the directory regularly for changes (maybe using the java.util.Timer and TimerTask classes).


Ping & DNS - updated with new look and Ping home screen widget
Faraz Ka
Ranch Hand

Joined: Jun 01, 2013
Posts: 44
Hello Ulf,

I'm using Java 7 and hence will try out the API that you mentioned.

Thanks,
Faraz
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Dynamically reading the files at runtime
 
Similar Threads
Ent Java Prog w/ IBM WAS - Question Chapter 15
Difference between include directive and jsp:include
Please anwer to my question?
Problem in connecting java web application with database using context file in Tomcat 7
Java Dynamic Servlet