hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Olindo Pindaro <o.pind...@gmail.com>
Subject posting a mail using webdav
Date Wed, 25 Mar 2009 14:18:25 GMT
Hi all,

I use jackrabbit webdav client (which extends  httpclient) to access
exchange server through webav.
Actually I read an email from exchange folder, I extract attached
email, and I need to put this
email (the attached one) in an other folder. I tried to post to
message using to following code. dto.getAttachedMes() is valid
MimeMessage object.

But the result is a "char jam" in the first case and the plain/xml
MimeMessage in 2nd case.

Someone can help me?

Regards
Olindo Pindaro




public void postMail(ProtocolMailItemDto dto, String destFolder)
throws IOException, MessagingException{
               String name=dto.getProtocoller()+"_"+(new
Date())+"_"+dto.getAttachedMes().getSubject();
               String url=destFolder+"/"+URLEncoder.encode(name,"UTF-8");
               HttpClient httpclient =
this.getServerPars().HttpClientFactory();
               PutMethod httpPut=new PutMethod(url);
           RequestEntity requestEntity = new
InputStreamRequestEntity(dto.getAttachedMes().getInputStream()); 1
case <<<<<<<<<<<<<<<<<<< I tried
both...
          RequestEntity requestEntity = new
InputStreamRequestEntity(dto.getAttachedMes().getInputStream(),
"message/rfc822");2 case <<<<<<
           httpPut.setRequestEntity(requestEntity);
           try {
               httpclient.executeMethod(httpPut);
               JPLogger.info("postmail GetStatus
="+httpPut.getStatusLine(),this.getClass());
               } finally {
                       httpPut.releaseConnection();
               }

       }


-- 
Olindo Pindaro
http://www.linkedin.com/in/olindopindaro
+39 3939455830

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Mime
View raw message