RE: File upload - as stream
Thanks, for some reason I missed that when looking at the apache fileupload api. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=1301927
RE: StatusService getRepresentation and Variant
Hi Tim, In your case, as you are outside a Resource you might want to leverage the ClientInfo#getPreferredVariant(ListVariant variants, Language defaultLanguage) method directly. It is also used by Resource#getPreferredVariant(). Best regards, Jerome Louvel -- Restlet ~ Founder and Lead developer ~ http://www.restlet.org Noelios Technologies ~ Co-founder ~ http://www.noelios.com -Message d'origine- De : Thierry Boileau [mailto:thierry.boil...@noelios.com] Envoyé : samedi 7 mars 2009 09:01 À : discuss@restlet.tigris.org Objet : Re: StatusService getRepresentation and Variant Hello Tim, you can call the Resource#getPreferredVariant method. Best regards, Thierry Boileau Would anyone be able to recommend the correct way to determine what the preferred Variant was for the requested Resource from the StatusService.getRepresentation() method? I would like to return different representations of error messages based on the Variant requested for the original resource. I am currently using Restlet 1.1.3. Thanks, Tim -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId =1277561 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=12814 72 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=1302764
Re: Grizzly NIO examples
I am having a little hard time understanding the real benefit of using the Grizzly NIO with Restlet. (or the way I am suppose to use, to be more precise) Lets assume I have a Resource that does a long I/O (that talks to an external server through a socket connection) and process what returns from external server so that the Resource returns some StringRepresentation as a result. Assuming a fresh new thread is created for each Resource and for the socket connection to the external server. What would be the real benefit of switching to Grizzly I/O Server and how should this be accomplished. Should only using the Grizzly Connector improve performance since the server will handle the NIO or should I change the current code to implement some Reactor pattern? Any help is highly appreciated. Bora -- From: Stephan Koops stephan.ko...@web.de Sent: Wednesday, February 25, 2009 5:35 PM To: discuss@restlet.tigris.org Subject: Re: Grizzly NIO examples Hi Bora, normaly just put the connector in the classpath and everything is done ... best regards Stephan bora schrieb: Being also new to Grizzly, I couldn't even came across any unit tests on the usage of Grizzly NIO Connector. Is there any documentation on how to use the connector. Thanks in advance Bora -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=1228992 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=1304378
Grizzly NIO
I am having a little hard time understanding the real benefit of using the Grizzly NIO with Restlet. (or the way I am suppose to use, to be more precise) Lets assume I have a Resource that does a long I/O (that talks to an external server through a socket connection) and process what returns from external server so that the Resource returns some StringRepresentation as a result. Assuming a fresh new thread is created for each Resource and for the socket connection to the external server. What would be the real benefit of switching to Grizzly I/O Server and how should this be accomplished. Should only using the Grizzly Connector improve performance since the server will handle the NIO or should I change the current code to implement some Reactor pattern? Any help is highly appreciated. Bora PS: Sorry for the old confusing subject -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=1304438
Guards
I've read the tutorial, but it doesn't answer all my questions. 1) Where do I set the Guard? I only need it on a couple of resources, so I was thinking I should create it in the constructor for the Resource. Does this seem logical/reasonable? 2) The example shows a call to getSecrets().put(). Does this mean I have to preload all my credentials when I create the Guard? I was hoping I could just grab the client-supplied username and password and let my own code decide if the user should be allowed in. 3) How does the flow work with challenges? Maybe this is related to question #1 above, but how does the Guard intercept the request, send the challenge, and then accept the new request without the Resource going away or being re-created? Especially with Digest, I dont think you'd want to re-create the Guard else the nonce would likely change? Any help or guidance would be appreciated! Mike -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=1304872
Intermitent error: A response with an unavailable entity was returned
Hi All, I have very puzzling situation. My application can be deployed in two modes 1. Runs as embedded Jetty 2. Runs as war under standalone Jetty There is a very simple code: public void handleGet() { FileRepresentation fr = new FileRepresentation( new File( this.getClass().getResource( path ).getFile() ), MediaType.TEXT_XML, 1000 ); getResponse().setEntity( fr ); getResponse().setStatus( Status.SUCCESS_OK ); } That executes just fine under #1 scenario but returns nothing but the following working under #2 [WARNING][org.restlet.Component.Server] A response with an unavailable entity was returned. Ignoring the entity for resource I'm using Restlet 1.1.3. Any suggestions much appreciated. Thanks -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=1304933