Package org.apache.abdera.protocol.client.util

Examples of org.apache.abdera.protocol.client.util.MultipartRelatedRequestEntity


   * @param media The media object that will be sent as the second element of the multipart/related object
   * @param contentType the content type of the media object
   * @param options The request options
   */
  public ClientResponse post(String uri, Entry entry, InputStream media, String contentType, RequestOptions options) {
    return execute("POST", uri, new MultipartRelatedRequestEntity(entry, media, contentType), options);
  }
View Full Code Here


   * @param media The media object that will be sent as the second element of the multipart/related object
   * @param contentType the content type of the media object
   * @param options The request options
   */
  public ClientResponse post(String uri, Entry entry, InputStream media, String contentType, RequestOptions options) {
    return execute("POST", uri, new MultipartRelatedRequestEntity(entry, media, contentType), options);
  }
View Full Code Here

    entry.setTitle("my image");
    entry.addAuthor("david");
    entry.setId("tag:apache.org,2008:234534344");
    entry.setSummary("multipart test");
    entry.setContent(new IRI("cid:234234@example.com"), "image/jpg");
    RequestEntity request = new MultipartRelatedRequestEntity(entry, this.getClass().getResourceAsStream("info.png"),
        "image/jpg", "asdfasdfasdf");
   
    StringWriter sw = new StringWriter();
    WriterOutputStream os = new WriterOutputStream(sw);
    request.writeRequest(os);
   
    String multipart = sw.toString();
    //System.out.println(sw.toString());
   
    assertTrue(multipart.contains("content-id: <234234@example.com>"));
View Full Code Here

        entry.addAuthor("david");
        entry.setId("tag:apache.org,2008:234534344");
        entry.setSummary("multipart test");
        entry.setContent(new IRI("cid:234234@example.com"), "image/jpg");
        RequestEntity request =
            new MultipartRelatedRequestEntity(entry, this.getClass().getResourceAsStream("info.png"), "image/jpg",
                                              "asdfasdfasdf");

        StringWriter sw = new StringWriter();
        WriterOutputStream os = new WriterOutputStream(sw);
        request.writeRequest(os);

        String multipart = sw.toString();
        // System.out.println(sw.toString());

        assertTrue(multipart.contains("content-id: <234234@example.com>"));
View Full Code Here

     * @param media The media object that will be sent as the second element of the multipart/related object
     * @param contentType the content type of the media object
     * @param options The request options
     */
    public ClientResponse post(String uri, Entry entry, InputStream media, String contentType, RequestOptions options) {
        return execute("POST", uri, new MultipartRelatedRequestEntity(entry, media, contentType), options);
    }
View Full Code Here

TOP

Related Classes of org.apache.abdera.protocol.client.util.MultipartRelatedRequestEntity

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.