Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to get the last modified time for directory?

807605Sep 6 2007 — edited Sep 7 2007
Hi,

I have to accomplish this.

A folder c:\myfolder can literally contain anything files.. sub directories, fiels in sub directories.

I have a thread monitoring c:\myfolder, basically people can dump files in any order into that directory and I have to trigger something when there is no activity on c:\myfolder for 10 secs.

I tried lastModified() with File("c:\myfolder") but that seems to be working only if there is some change on root level of c:\myfolder, for eg if I have a sub folder c:\myfolder\subfolder and I copy some file into c:\myfolder\subfolder, then the lastModified() doesnt seem to be updatiing on the mail folder "c:\myfolder"

Is there a way I can handle this situation?

Any suggession is appreciated.

Thanks in advance.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 5 2007
Added on Sep 6 2007
3 comments
180 views