Hi,
This "limitation" concerns the following representation classes (and
descendants included in the Restlet API and NRE) :
- InputRepresentation
- ReadableRepresentation
- ReaderRepresentation
Some representations can be retrieved several times if their source is
stable and accessible, like a local file or a string. But some others
can only be retrieved once (such as representations based on streams get
from TCP/IP sockets). You can check the following attributes of a
representation :
- transient => the representation content can be obtained only once
- available => is the representation content available or not?
If you want to extract some data in one part of your code, and extract
some others in another one from a representation that is transient, you
need to read your representation once and make it persistant (in a
string, file, etc).
I hope this will help you.
Best regards,
Thierry Boileau
I won't be much help, but have you checked the
Request.isEntityAvailable() ? I found that using
Request.getEntityAsFoo() doesn't always mean there's nothing there.
Sorry I don't have more, I'm still learning it my self.
Alan wrote:
hello, I'd like to write a custom gaurd that can, in addition to
using standard
authentication mechanisms, look for credentials in a request, for
example in a
query string (if the client wishes) or url encoded post data.
Is there some way to obtain these credentials as a Form and still
have the
entity be available to those resources protected by the guard?
Because accessing
the entity as a form within the guard causes the entity to not be
available (at
least through the Request.getEntityAsFoo) further down the chain.
I imagine this would apply to filters in general.
Do I need to pack that state away somewhere myself?
Hopefully the question is clear, I'm still wrapping my head around
the restlet
API (as well as REST) so it may not be.
thanks