I think there is a bug in DirValidity class (nested in DirectoryGenerator
class):
public int isValid() {
if (System.currentTimeMillis() <= expiry) {
return 1;
}
expiry = System.currentTimeMillis() + delay;
int len = files.size();
for (int i = 0; i < len; i++) {
File f = (File)files.get(i);
if (!f.exists()) {
return -1; // File was removed
}
long oldDate = ((Long)fileDates.get(i)).longValue();
long newDate = f.lastModified();
if (oldDate != newDate) {
return -1;
}
}
// all content is up to date: update the expiry date
expiry = System.currentTimeMillis() + delay;
return 1;
}
directory isn't valid only when a file was removed or 'lastmodified' dates
aren't equal.
it is necessary to check a number of files in that directory also...
U�ytkownik "Jan Wielgus" <[EMAIL PROTECTED]> napisa� w wiadomo�ci
news:[EMAIL PROTECTED]
> >You wouldn't want an Action to do that - but a Generator, and there
> are
> >several included by default. Look in the user docs under Generators -
> >you'll find at least DirectoryGenerator and ImageDirectoryGenerator
> >there. I think there are others with more sophisticated options which
> >may be not as well documented.
>
> Thank you for the tip. I use now the ImageDirectoryGenerator but I
> have one problem with it. If I add a file to a directory given as a
> parameter and then refresh the site, the xml generated doesn't show
> the new file. But whenever I delete anything from this directory,
> the changes are showed at once. When I copy new files to the
> directory, the changes are showed only after I have restarted the
> servlet engine (in my case Jetty, I am using Coccon 2.1.2). What can
> cause this strange behaviour? I have tried to set the
> "refreshDelay"-parameters for some different values, but the xml
> generated by the ImageDirectoryGenerator never changes until I
> restart the servlet engine...
>
> Jan
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]