Package org.jboss.resteasy.plugins.providers.multipart

Examples of org.jboss.resteasy.plugins.providers.multipart.MultipartRelatedOutput


   @Test
   public void testMultipartRelatedOutput() throws Exception
   {
      MultipartClient client = ProxyFactory.create(MultipartClient.class,
              generateBaseUrl());
      MultipartRelatedOutput output = new MultipartRelatedOutput();
      output.setStartInfo("text/xml");

      Map<String, String> mediaTypeParameters = new LinkedHashMap<String, String>();
      mediaTypeParameters.put("charset", "UTF-8");
      mediaTypeParameters.put("type", "text/xml");
      output
              .addPart(
                      "<m:data xmlns:m='http://example.org/stuff'>"
                              + "<m:photo><xop:Include xmlns:xop='http://www.w3.org/2004/08/xop/include' href='cid:http://example.org/me.png'/></m:photo>"
                              + "<m:sig><xop:Include xmlns:xop='http://www.w3.org/2004/08/xop/include' href='cid:http://example.org/my.hsh'/></m:sig>"
                              + "</m:data>", new MediaType("application",
                              "xop+xml", mediaTypeParameters),
                      "<mymessage.xml@example.org>", "8bit");
      output.addPart("// binary octets for png",
              new MediaType("image", "png"), "<http://example.org/me.png>",
              "binary");
      output.addPart("// binary octets for signature", new MediaType(
              "application", "pkcs7-signature"),
              "<http://example.org/me.hsh>", "binary");
      client.putRelated(output);
   }
View Full Code Here


   @Test
   public void testMultipartRelatedOutput() throws Exception
   {
      MultipartClient client = ProxyFactory.create(MultipartClient.class,
              generateBaseUrl());
      MultipartRelatedOutput output = new MultipartRelatedOutput();
      output.setStartInfo("text/xml");

      Map<String, String> mediaTypeParameters = new LinkedHashMap<String, String>();
      mediaTypeParameters.put("charset", "UTF-8");
      mediaTypeParameters.put("type", "text/xml");
      output
              .addPart(
                      "<m:data xmlns:m='http://example.org/stuff'>"
                              + "<m:photo><xop:Include xmlns:xop='http://www.w3.org/2004/08/xop/include' href='cid:http://example.org/me.png'/></m:photo>"
                              + "<m:sig><xop:Include xmlns:xop='http://www.w3.org/2004/08/xop/include' href='cid:http://example.org/my.hsh'/></m:sig>"
                              + "</m:data>", new MediaType("application",
                              "xop+xml", mediaTypeParameters),
                      "<mymessage.xml@example.org>", "8bit");
      output.addPart("// binary octets for png",
              new MediaType("image", "png"), "<http://example.org/me.png>",
              "binary");
      output.addPart("// binary octets for signature", new MediaType(
              "application", "pkcs7-signature"),
              "<http://example.org/me.hsh>", "binary");
      client.putRelated(output);
   }
View Full Code Here

TOP

Related Classes of org.jboss.resteasy.plugins.providers.multipart.MultipartRelatedOutput

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.