Ok. We might also want to ad retry to the delete in case another instance is reading.
We can implement removeAll, we can simply clear the directory. We also might want to make it possible to limit the number of files and to cleanup based on age. Your patch is against really old code. I'm updating. Aaron --- On Wed, 6/17/09, Tore Halset <hal...@pvv.ntnu.no> wrote: > From: Tore Halset <hal...@pvv.ntnu.no> > Subject: Re: Indexed Disk Cache safe copying of files > To: "JCS Users List" <jcs-users@jakarta.apache.org> > Date: Wednesday, June 17, 2009, 1:57 PM > On Jun 17, 2009, at 22:50, Aaron > Smuts wrote: > > > We need to think through the way updates are > done. If these will be shared, we'll have to have some > kind of lock, perhaps another file with the same name with a > .lock suffix. . . . . . > > As you see from the patch, I create a new tmp file and > rename it after write. Several writers can write in > parallel, and the last will win. > > File tmp = File.createTempFile("cache", null, dir); > ... > tmp.renameTo(file); > > Regards, > - Tore. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: jcs-users-unsubscr...@jakarta.apache.org > For additional commands, e-mail: jcs-users-h...@jakarta.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: jcs-users-unsubscr...@jakarta.apache.org For additional commands, e-mail: jcs-users-h...@jakarta.apache.org