drools-eclipse/org.guvnor.eclipse.webdav/src/kernel/org/eclipse/webdav/internal/kernel/EntityTag.java
public static ConditionFactor create(StreamTokenizer tokenizer) throws WebDAVException {
        EntityTag entityTag = new EntityTag();
        try {
            int token = tokenizer.ttype;
            if (token == '[')
                token = tokenizer.nextToken();
            else
                throw new WebDAVException(IResponse.SC_BAD_REQUEST, Policy.bind("error.parseMissing", String.valueOf(token), "[")); //$NON-NLS-1$ //$NON-NLS-2$
            if (token == '"') { //$NON-NLS-1$
                entityTag.setETag(tokenizer.sval);
                token = tokenizer.nextToken();
            } else
                throw new WebDAVException(IResponse.SC_BAD_REQUEST, Policy.bind("error.parseMissingQuotedString", String.valueOf(token))); //$NON-NLS-1$
            if (token == ']')
                token = tokenizer.nextToken();
            else
                throw new WebDAVException(IResponse.SC_BAD_REQUEST, Policy.bind("error.parseMissing", String.valueOf(token), "]")); //$NON-NLS-1$ //$NON-NLS-2$
        } catch (IOException exc) {
            // ignore or log?
        }
        return entityTag;
    }
public static ConditionFactor create(StreamTokenizer tokenizer) throws WebDAVException {
        EntityTag entityTag = new EntityTag();
        try {
            int token = tokenizer.ttype;
            if (token == '[')
                token = tokenizer.nextToken();
            else
                throw new WebDAVException(IResponse.SC_BAD_REQUEST, Policy.bind("error.parseMissing", String.valueOf(token), "[")); //$NON-NLS-1$ //$NON-NLS-2$
            if (token == '"') { //$NON-NLS-1$
                entityTag.setETag(tokenizer.sval);
                token = tokenizer.nextToken();
            } else
                throw new WebDAVException(IResponse.SC_BAD_REQUEST, Policy.bind("error.parseMissingQuotedString", String.valueOf(token))); //$NON-NLS-1$
            if (token == ']')
                token = tokenizer.nextToken();
            else
                throw new WebDAVException(IResponse.SC_BAD_REQUEST, Policy.bind("error.parseMissing", String.valueOf(token), "]")); //$NON-NLS-1$ //$NON-NLS-2$
        } catch (IOException exc) {
            // ignore or log?
        }
        return entityTag;
    }
public static ConditionFactor create ( StreamTokenizer tokenizer ) throws WebDAVException { EntityTag entityTag = new EntityTag ( ) ; try { int token = tokenizer . ttype ; if ( token == ' ' ) token = tokenizer . nextToken ( ) ; else throw new WebDAVException ( IResponse . SC_BAD_REQUEST , Policy . bind ( "error.parseMissing" , String . valueOf ( token ) , "[" ) ) ; //$NON-NLS-1$ //$NON-NLS-2$ if ( token == ' ' ) { //$NON-NLS-1$ entityTag . setETag ( tokenizer . sval ) ; token = tokenizer . nextToken ( ) ; } else throw new WebDAVException ( IResponse . SC_BAD_REQUEST , Policy . bind ( "error.parseMissingQuotedString" , String . valueOf ( token ) ) ) ; //$NON-NLS-1$ if ( token == ' ' ) token = tokenizer . nextToken ( ) ; else throw new WebDAVException ( IResponse . SC_BAD_REQUEST , Policy . bind ( "error.parseMissing" , String . valueOf ( token ) , "]" ) ) ; //$NON-NLS-1$ //$NON-NLS-2$ } catch ( IOException exc ) { // ignore or log? } return entityTag ; }
Create an EntityTag by parsing the given If header as defined by
section 3.11 of the HTTP/1.1 spec.

@param tokenizer a StreamTokenizer on the contents of a WebDAV If header
@return the parsed ConditionFactor (EntityTag)
@exception WebDAVException thrown if there is a syntax error in the If header
Create an EntityTag by parsing the given If header as defined by section 3 . 11 of the HTTP / 1 . 1 spec .