org.eclipse.webdav.internal.kernel
Class ConditionFactor

java.lang.Object
  extended by org.eclipse.webdav.internal.kernel.ConditionFactor
Direct Known Subclasses:
EntityTag, StateToken

public abstract class ConditionFactor
extends Object

A ConditionFactor represents some state of a resource that must be satisfied in order for the associated request to be valid. The ConditionFactors in a ConditionTerm must all match with states of the resource, i.e., they are AND'ed together. Conditions are contained in a Precondition which is used in a WebDAV If header. ConditionFactors are either constructed by the client, or may have been given to the client in a previous method request. A ConditionFactor can be either a StateToken or an EntityTag as defined by section 9.4 of the WebDAV spec.


Constructor Summary
ConditionFactor()
           
 
Method Summary
static ConditionFactor create(StreamTokenizer tokenizer)
          Create a ConditionFactor (either a StateToken or EntityTag) by parsing the tokenizer contining an If header value.
 boolean not()
          Negate the comparison on this ConditionFactor?
 void setNot(boolean value)
          Set how to compare to this ConditionFactor.
abstract  String toString()
          Return a String representation of this ConditionFactor as defined by the If header in section 9.4 of the WebDAV spec.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConditionFactor

public ConditionFactor()
Method Detail

create

public static ConditionFactor create(StreamTokenizer tokenizer)
                              throws WebDAVException
Create a ConditionFactor (either a StateToken or EntityTag) by parsing the tokenizer contining an If header value.

Parameters:
tokenizer - a StreamTokenizer containing the contents of a state token or entity tag from a WebDAV If header
Returns:
the parsed ConditionFactor
Throws:
WebDAVException - thrown if there is a syntax error in the If header

not

public boolean not()
Negate the comparison on this ConditionFactor?

Returns:
true if the condition factor was negated in the If header

setNot

public void setNot(boolean value)
Set how to compare to this ConditionFactor. Value is true implies match for a valid request, false implies the request is valid only if the ConditionFactor doesn't match.

Parameters:
value - true means negate the condition

toString

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

Overrides:
toString in class Object
Returns:
a string representation of a state token or entity tag


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