Package org.apache.abdera

Examples of org.apache.abdera.Abdera.newEntry()


  public static void main(String... args) throws Exception {
   
    String text = "\u05e4\u05e2\u05d9\u05dc\u05d5\u05ea \u05d4\u05d1\u05d9\u05e0\u05d0\u05d5\u05dd, W3C";
   
    Abdera abdera = new Abdera();
    Entry entry = abdera.newEntry();
    BidiHelper.setDirection(Direction.RTL, entry);
   
    entry.setTitle(text);
   
    // non bidi, incorrectly displayed
View Full Code Here


        BidiHelper.getDirection(entry),
        entry.getTitle()));
   

    // there are also direction guessing algorithms available
    entry = abdera.newEntry();
    entry.setTitle(text);
    entry.setLanguage("ar");
   
    System.out.println(BidiHelper.guessDirectionFromJavaBidi(entry.getTitleElement()));
    System.out.println(BidiHelper.guessDirectionFromTextProperties(entry.getTitleElement()));
View Full Code Here

public class Json {

  public static void main(String... args) throws Exception {
   
    Abdera abdera = new Abdera();
    Entry entry = abdera.newEntry();
    entry.newId();
    entry.setTitle("test");
    entry.setContentAsHtml("<b>foo</b>");
    entry.addAuthor("James");
    entry.addCategory("term");
View Full Code Here

public class EncodingTest extends Assert {
   
  @Test
    public void testContentEncoding() throws Exception {
        Abdera abdera = new Abdera();
        Entry entry = abdera.newEntry();
        entry.setId("http://example.com/entry/1");
        entry.setTitle("Whatever");
        entry.setUpdated(new Date());
        Content content = entry.getFactory().newContent(Content.Type.XML);
        String s = "<x>" + new Character((char) 224) + "</x>";
View Full Code Here

     * Passes if the test does not throw a parse exception
     */
  @Test
    public void testCompressionCodec() throws Exception {
      Abdera abdera = new Abdera();
      Entry entry = abdera.newEntry();
      ByteArrayOutputStream out = new ByteArrayOutputStream();
      OutputStream cout = CompressionUtil.getEncodedOutputStream(out, CompressionCodec.GZIP);
      entry.writeTo(cout);
      cout.close();
      byte[] bytes = out.toByteArray();
View Full Code Here

     * Passes if the test does not throw any exceptions
     */
  @Test
    public void testWriterOptions() throws Exception {
      Abdera abdera = new Abdera();
      Entry entry = abdera.newEntry();
      entry.setTitle("1");
     
      ByteArrayOutputStream out = new ByteArrayOutputStream();
      WriterOptions writeoptions = entry.getDefaultWriterOptions();
      writeoptions.setCompressionCodecs(CompressionCodec.DEFLATE);
View Full Code Here

  public static void main(String... args) throws Exception {
   
    ID id = new ID("myblog","entries","abc123xyz");
   
    Abdera abdera = Abdera.getInstance();
    Entry entry = abdera.newEntry();
    entry.setId(Template.expandAnnotated(id));
    entry.setTitle("This is a test");
    entry.writeTo("prettyxml",System.out);
   
  }
View Full Code Here

public class EncodingTest extends TestCase {
   
    public void testContentEncoding() throws Exception {
        Abdera abdera = new Abdera();
        Entry entry = abdera.newEntry();
        entry.setId("http://example.com/entry/1");
        entry.setTitle("Whatever");
        entry.setUpdated(new Date());
        Content content = entry.getFactory().newContent(Content.Type.XML);
        String s = "<x>" + new Character((char) 224) + "</x>";
View Full Code Here

    /**
     * Passes if the test does not throw a parse exception
     */
    public void testCompressionCodec() throws Exception {
      Abdera abdera = new Abdera();
      Entry entry = abdera.newEntry();
      ByteArrayOutputStream out = new ByteArrayOutputStream();
      OutputStream cout = CompressionUtil.getEncodedOutputStream(out, CompressionCodec.GZIP);
      entry.writeTo(cout);
      cout.close();
      byte[] bytes = out.toByteArray();
View Full Code Here

    /**
     * Passes if the test does not throw any exceptions
     */
    public void testWriterOptions() throws Exception {
      Abdera abdera = new Abdera();
      Entry entry = abdera.newEntry();
      entry.setTitle("1");
     
      ByteArrayOutputStream out = new ByteArrayOutputStream();
      WriterOptions writeoptions = entry.getDefaultWriterOptions();
      writeoptions.setCompressionCodecs(CompressionCodec.DEFLATE);
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.