Package org.apache.abdera.model

Examples of org.apache.abdera.model.Entry.writeTo()


        url = new URL(generateBaseUrl() + "/packages/restPackage1/assets/model1");
        HttpURLConnection conn = (HttpURLConnection) url.openConnection();
        conn.setRequestMethod("PUT");
        conn.setRequestProperty("Content-type", MediaType.APPLICATION_ATOM_XML);
        conn.setDoOutput(true);
        e.writeTo(conn.getOutputStream());

        assertEquals(204, conn.getResponseCode());
        conn.disconnect();
    }
View Full Code Here


       
        connection = (HttpURLConnection) url.openConnection();
        connection.setRequestMethod("PUT");
        connection.setRequestProperty("Content-type", MediaType.APPLICATION_ATOM_XML);
        connection.setDoOutput(true);
        entry.writeTo(connection.getOutputStream());
        assertEquals(204, connection.getResponseCode());
        connection.disconnect();
       
        //Verify again
        connection = (HttpURLConnection)url.openConnection();
View Full Code Here

       
        connection = (HttpURLConnection) url.openConnection();
        connection.setRequestMethod("PUT");
        connection.setRequestProperty("Content-type", MediaType.APPLICATION_ATOM_XML);
        connection.setDoOutput(true);
        entry.writeTo(connection.getOutputStream());
        assertEquals(500, connection.getResponseCode());
        connection.disconnect();               
    }
   
    @Test
View Full Code Here

    }
   
    private Entry addEntry(String endpointAddress) throws Exception {
        Entry e = createBookEntry(256, "AtomBook");
        StringWriter w = new StringWriter();
        e.writeTo(w);
       
        PostMethod post = new PostMethod(endpointAddress);
        post.setRequestEntity(
             new StringRequestEntity(w.toString(), "application/atom+xml", null));
        HttpClient httpclient = new HttpClient();
View Full Code Here

                          + " application/xhtml+xml, image/png, image/jpeg, image/gif,"
                          + " image/x-xbitmap, */*;q=0.1");
       
        Entry e = createBookEntry(256, "AtomBook");
        StringWriter w = new StringWriter();
        e.writeTo(w);
       
        PostMethod post = new PostMethod(endpointAddress);
        post.setRequestEntity(
             new StringRequestEntity(w.toString(), "application/atom+xml", null));
        HttpClient httpclient = new HttpClient();
View Full Code Here

       
        connection = (HttpURLConnection) url.openConnection();
        connection.setRequestMethod("PUT");
        connection.setRequestProperty("Content-type", MediaType.APPLICATION_ATOM_XML);
        connection.setDoOutput(true);
        entry.writeTo(connection.getOutputStream());
        assertEquals(204, connection.getResponseCode());
        connection.disconnect();
       
        //Verify again
        connection = (HttpURLConnection)url.openConnection();
View Full Code Here

       
        connection = (HttpURLConnection) url.openConnection();
        connection.setRequestMethod("PUT");
        connection.setRequestProperty("Content-type", MediaType.APPLICATION_ATOM_XML);
        connection.setDoOutput(true);
        entry.writeTo(connection.getOutputStream());
        assertEquals(500, connection.getResponseCode());
        connection.disconnect();               
    }
   
    @Test
View Full Code Here

    }
   
    private Entry addEntry(String endpointAddress) throws Exception {
        Entry e = createBookEntry(256, "AtomBook");
        StringWriter w = new StringWriter();
        e.writeTo(w);
       
        PostMethod post = new PostMethod(endpointAddress);
        post.setRequestEntity(
             new StringRequestEntity(w.toString(), "application/atom+xml", null));
        HttpClient httpclient = new HttpClient();
View Full Code Here

        Entry entry = abdera.newEntry();

        entry.setContent(new IRI("http://example.org/xml"), "text/xml");

        Writer json = abdera.getWriterFactory().getWriter("json");
        entry.writeTo(json, System.out);
    }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.