Package org.apache.abdera.util

Examples of org.apache.abdera.util.EntityTag


      setHeader("Content-Type", mimeType.toString());
    } catch (Exception e) {}
  }
 
  public void setEntityTag(String etag) {
    setEntityTag(new EntityTag(etag));
  }
View Full Code Here


   
    options.setHeader("foo", "bar");
    assertEquals(options.getHeader("foo"),"bar");
   
    options.setIfMatch("testing");
    assertTrue(EntityTag.matchesAny(new EntityTag("testing"), options.getIfMatch()));
   
    options.setIfNoneMatch("testing");
    assertTrue(EntityTag.matchesAny(new EntityTag("testing"), options.getIfNoneMatch()));
   
    options.setSlug("This is the slug");
    assertEquals(options.getSlug(),"This is the slug");
   
    options.setUsePostOverride(true);
View Full Code Here

    // YAY! We can handle media link entries
  }
 
  public void testEntityTag() throws Exception {
    EntityTag tag1 = new EntityTag("tag");
    EntityTag tag2 = new EntityTag("tag",true); // weak;
    assertFalse(tag1.isWeak());
    assertTrue(tag2.isWeak());
    assertFalse(EntityTag.matches(tag1, tag2));
    assertFalse(EntityTag.matchesAny(tag1, new EntityTag[] {tag2}));
    assertEquals(tag1.toString(), "\"tag\"");
    assertEquals(tag2.toString(), "W/\"tag\"");
    tag1 = EntityTag.parse("\"tag\"");
    assertFalse(tag1.isWeak());
    assertEquals(tag1.getTag(), "tag");
    tag2 = EntityTag.parse("W/\"tag\"");
    assertTrue(tag2.isWeak());
    assertEquals(tag2.getTag(), "tag");   
    EntityTag[] tags = EntityTag.parseTags("\"tag1\", W/\"tag2\"");
    assertFalse(tags[0].isWeak());
    assertEquals(tags[0].getTag(), "tag1");
    assertTrue(tags[1].isWeak());
    assertEquals(tags[1].getTag(), "tag2");
View Full Code Here

  public void setEntityTag(EntityTag tag) {
    this.etag = tag;
  }

  public void setEntityTag(String tag) {
    this.etag = new EntityTag(tag);
  }
View Full Code Here

 
  /**
   * Sets the value of the HTTP If-Match header
   */
  public void setIfMatch(String entity_tag) {
    setIfMatch(new EntityTag(entity_tag));
  }
View Full Code Here

 
  /**
   * Sets the value of the HTTP If-None-Match header
   */
  public void setIfNoneMatch(String entity_tag) {
    setIfNoneMatch(new EntityTag(entity_tag));
  }
View Full Code Here

        this.etag = tag;
        return this;
    }

    public Document<T> setEntityTag(String tag) {
        this.etag = new EntityTag(tag);
        return this;
    }
View Full Code Here

TOP

Related Classes of org.apache.abdera.util.EntityTag

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.