File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Java » Java in General
Bookmark "Detect new file in a directory" Watch "Detect new file in a directory" New topic

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.

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.
I agree. Here's the link:
subject: Detect new file in a directory
It's not a secret anymore!