[rules-users] Resource Change Scanner Service modified date error
Esteban Aliverti
esteban.aliverti at gmail.com
Fri Jan 6 05:08:30 EST 2012
As Dean says, getting the modification time of an in-memory resource is
impossible (actually you need to create an external mechanism to keep track
of it). So I would suggest to change the thrown Exception to something more
meaningful and to explicitly document which resources are capable to be
scanned for changes.
Right now, the Resources capable to being scanned are:
- ClasspathResource
- UrlResource
- FileSystemResource
- EncodedResource (depending on the implementation of Resource it is
using)
@Wolfgang, for non in-memory Resources like files or url resources you can
get the last modified time. This is used by the scanner to check if a
particular resource has been modified since the last time it was scanned.
As Dean mentioned, this is not feasible when the resource is an in-memory
resource like a ByteArrayResource.
Best Regards,
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Esteban Aliverti
- Developer @ http://www.plugtree.com impossible <http://www.plugtree.com>
- Blog @ http://ilesteban.wordpress.com
On Fri, Jan 6, 2012 at 10:51 AM, Dean <dean at qualica.com> wrote:
> @Esteban - I've tried both the ClassPathResource and UrlResource and
> haven't
> actually tried ReaderResource.
>
> I see what you mean with the source code, I did notice that specific error
> message appears for ReaderResource, but I don't know how my code is
> getting
> there. I will debug it and find out what is going on when I get a moment.
>
> I notice that getLastModified also isn't implemented for
> InputStreamResource
> (with a different error message).
>
> How would you propose returning a modified date for a ByteArrayResource,
> ReaderResource or InputStreamResource as these are in-memory objects and
> don't actually have a modified date?
>
> Regards
>
> Dean
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Resource-Change-Scanner-Service-modified-date-error-tp3634802p3637468.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20120106/9cd12d29/attachment.html
More information about the rules-users
mailing list