org.eclipse.webdav.internal.kernel
Class EntityTag

java.lang.Object
  extended by org.eclipse.webdav.internal.kernel.ConditionFactor
      extended by org.eclipse.webdav.internal.kernel.EntityTag

public class EntityTag
extends ConditionFactor

An EntityTag is a ConditionFactor describing some state of a resource represented as an opaque string. See section 3.11 of the HTTP/1.1 spec.


Constructor Summary
EntityTag(String tag)
          Construct a EntityTag with the given opaque string tag.
 
Method Summary
static ConditionFactor create(StreamTokenizer tokenizer)
          Create an EntityTag by parsing the given If header as defined by section 3.11 of the HTTP/1.1 spec.
 boolean equals(Object etag)
          Compare with another EntityTag.
static EntityTag generateEntityTag()
          Construct a unique EntityTag.
 String getETag()
          Get the ETag of this EntityTag.
 boolean isWeak()
          Is this a weak EntityTag?
 void setETag(String value)
          Set the ETag of this EntityTag.
 void setWeak(boolean value)
          Set the strength of this EntityTag.
 String toString()
          Return a String representation of this EntityTag as defined by the If header in section 9.4 of the WebDAV spec.
 
Methods inherited from class org.eclipse.webdav.internal.kernel.ConditionFactor
not, setNot
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EntityTag

public EntityTag(String tag)
Construct a EntityTag with the given opaque string tag.

Parameters:
tag - the opaque string defining the entity tag
Method Detail

create

public static ConditionFactor create(StreamTokenizer tokenizer)
                              throws WebDAVException
Create an EntityTag by parsing the given If header as defined by section 3.11 of the HTTP/1.1 spec.

Parameters:
tokenizer - a StreamTokenizer on the contents of a WebDAV If header
Returns:
the parsed ConditionFactor (EntityTag)
Throws:
WebDAVException - thrown if there is a syntax error in the If header

equals

public boolean equals(Object etag)
Compare with another EntityTag.

Overrides:
equals in class Object
Parameters:
etag - the entity tag to compare
Returns:
true if the tags are equal, false otherwise

generateEntityTag

public static EntityTag generateEntityTag()
Construct a unique EntityTag. The tag is constructed by concatening the current time with the current thread's hash code.

Returns:
a unique entity tag that servers may use for any purpose

getETag

public String getETag()
Get the ETag of this EntityTag. The ETag represents some state of the resource in the containing Condition.

Returns:
the etag

isWeak

public boolean isWeak()
Is this a weak EntityTag?

Returns:
true if this is a weak entity tag

setETag

public void setETag(String value)
Set the ETag of this EntityTag. The ETag represents some state of the resource in the containing Condition, for example, the lock token.


setWeak

public void setWeak(boolean value)
Set the strength of this EntityTag. value true indicates this is a weak entity tag


toString

public String toString()
Return a String representation of this EntityTag as defined by the If header in section 9.4 of the WebDAV spec.

Specified by:
toString in class ConditionFactor
Returns:
a string representation of this entity tag


Copyright © 2001-2014 JBoss by Red Hat. All Rights Reserved.