a gzip representation
I was looking for some guidance on how i would package a gzipped java serialized object. Do I need to extend ObjectRepresentation class and use content type application/gzip or is there some way I can use the ObjectRepresentation class with some form of encoding. cheers /jima
RE: a gzip representation
Hi Jim, You can have a look at the com.noelios.restlet.application.EncodeRepresentation class. We are also planning on adding an automatic/configurable encoding service: http://restlet.tigris.org/issues/show_bug.cgi?id=208 Best regards, Jerome -Message d'origine- De : Jim Alateras [mailto:[EMAIL PROTECTED] Envoyé : jeudi 12 avril 2007 15:19 À : [EMAIL PROTECTED] Objet : a gzip representation I was looking for some guidance on how i would package a gzipped java serialized object. Do I need to extend ObjectRepresentation class and use content type application/gzip or is there some way I can use the ObjectRepresentation class with some form of encoding. cheers /jima
Re: a gzip representation
Jerome Louvel wrote: Hi Jim, You can have a look at the com.noelios.restlet.application.EncodeRepresentation class. So i can use it to wrap an ObjectRepresentation. Will the Encoding i pass across to it override the HTTP content-type header (i.e. if the encoding is set to gzip then the content-type hesader will be application/gzip. cheers /jima
Re: a gzip representation
Hi Jim, I want to precise that the EncodeRepresentation automatically sets the content-encoding header and keep intact the content-type of the wrapped representation. It allows Firefox to decodes on the fly the gzip stream and restore the wrapped representation. If you want to use EncodeRepresentation because it provides the gzip compression service, just take car of setting the right content-type and content-encoding for your representation: Representation representation = new EncodeRepresentation(Encoding.GZIP, new StringRepresentation(Hello World!, MediaType.TEXT_PLAIN)); representation.setMediaType(MediaType.APPLICATION_GNU_ZIP); representation.getEncodings().clear(); I hope this will help you. Best regards, Thierry Boileau Hi Jim, You can have a look at the com.noelios.restlet.application.EncodeRepresentation class. So i can use it to wrap an ObjectRepresentation. Will the Encoding i pass across to it override the HTTP content-type header (i.e. if the encoding is set to gzip then the content-type hesader will be application/gzip. cheers /jima