Meaningless Drivel is fun!*
The moose likes Java in General and the fly likes Detect new file in a directory Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Detect new file in a directory" Watch "Detect new file in a directory" New topic
Author

Detect new file in a directory

Roy Cantos
Ranch Hand

Joined: Feb 22, 2002
Posts: 38
Hi Guys,
Is there a way that java can detect a new file, or existing API that we can use.

Thanks,
Roy
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
The way I do this, is to start a thread that runs over all files in the folder from time to time.
This way you can track which files were deleted and which ones are new.
Hope this helps.
Regards,
G´┐Żnther.
http://www.javacoding.net
 
Consider Paul's rocket mass heater.
 
subject: Detect new file in a directory
 
Similar Threads
java redirection
Checking for EOF
Detect new file in a directory
getting a filename
Detecting EOF?