从页面中解析出bdstoken等信息.
    
    这些信息都位于页面底部的<script>, 只有在授权后的页面中才出现.
    这里, 为了保证兼容性, 就不再使用cssselect模块解析了.

    @return 返回bdstoken
545361
def parse_bdstoken(content):
    '''
    '''
    bdstoken = ''
    bds_re = re.compile('"bdstoken"\s*:\s*"([^"]+)"', re.IGNORECASE)
    bds_match = bds_re.search(content)
    if bds_match:
        bdstoken = bds_match.group(1)
    return bdstoken
526489
protected String getCSS()
    {
        // The default styles to use
        String retVal =
            "body {\n" + "	font-family: Arial, Helvetica, sans-serif;\n" + "}\n" + "h1 {\n" + "	font-size: 1.5em;\n" + "}\n" + "th {\n"
                + "	background-color: #9DACBF;\n" + "}\n" + "table {\n" + "	border-top-style: solid;\n" + "	border-right-style: solid;\n"
                + "	border-bottom-style: solid;\n" + "	border-left-style: solid;\n" + "}\n" + "td {\n" + "	margin: 0px;\n" + "	padding-top: 2px;\n"
                + "	padding-right: 5px;\n" + "	padding-bottom: 2px;\n" + "	padding-left: 5px;\n" + "}\n" + "tr.even {\n"
                + "	background-color: #CCCCCC;\n" + "}\n" + "tr.odd {\n" + "	background-color: #FFFFFF;\n" + "}\n" + "";
        try
        {
            // Try loading one via class loader and use that one instead
            final ClassLoader cl = getClass().getClassLoader();
            final InputStream iStream = cl.getResourceAsStream( "webdav.css" );
            if ( iStream != null )
            {
                // Found css via class loader, use that one
                final StringBuilder out = new StringBuilder();
                final byte[] b = new byte[4096];
                for ( int n; ( n = iStream.read( b ) ) != -1; )
                {
                    out.append( new String( b, 0, n ) );
                }
                retVal = out.toString();
            }
        }
        catch ( final Exception ex )
        {
            LOG.error( "Error in reading webdav.css", ex );
        }

        return retVal;
    }
382600
public int getThisTaskIndex() {
    List<Integer> allTasks = getComponentTasks(getThisComponentId());
    int retVal = 0;
    for (Integer tsk : allTasks) {
      if (tsk < myTaskId) {
        retVal++;
      }
    }
    return retVal;
  }
74189
public static String wrapScript(String... s) {

        return SCRIPT_TAG_OPEN + CmsStringUtil.listAsString(Arrays.asList(s), "") + SCRIPT_TAG_CLOSE;
    }
1030183
public String getAsText() {
        Enum<?> value = (Enum<?>) getValue();
        if (value == null) {
            return "";
        }

        String text = getMessagesAccessor().getMessage(messagesKeyPrefix + value.name(), (String) null);
        if (text == null) {
            return value.toString();
        } else {
            return text;
        }
    }
833984
public String getMessage() {
        switch ( this.errorCode ) {
            case ERROR_UNUSED_TOKEN :
                return "Warning, the token " + this.token + " not used in the mapping.";
            case ERROR_UNDECLARED_TOKEN :
                return "Warning, the token " + this.token + " not found in the expression. (May not be a problem).";
            case ERROR_INVALID_TOKEN :
                return "Invalid token declaration at offset " + this.offset + ": " + this.token;
            case ERROR_UNMATCHED_BRACES :
                return "Unexpected } found at offset " + this.offset;
            default :
                return "Unkown error at offset: " + this.offset;
        }
    }
848551
private String getToken() {

        SessionData session = dataMgr.getSessionDAO().session();
        if (session != null && session.getExpiresOn() > System.currentTimeMillis()) {
            return session.getAccessToken();
        }

        return null;
    }
912674
public Map<String, TemplateTokenInfo> getTokensAsMap() {
        HashMap<String, TemplateTokenInfo> tokens = new HashMap<String, TemplateTokenInfo>();
        for (TemplateTokenInfo tokenInfo : tokenInfos)
            tokens.put(tokenInfo.getName(), tokenInfo);
        return Collections.unmodifiableMap(tokens);
    }
672353
function () {
                var self = this;
                return '#' + padding2(Number(self.get('r')).toString(16)) + padding2(Number(self.get('g')).toString(16)) + padding2(Number(self.get('b')).toString(16));
            }
970875
private Token nextToken() {
        skipSpaces();
        if (hasNextChar()) {
            char ch = nextChar();
            if (Character.isJavaIdentifierStart(ch)) {
                StringBuffer buf = new StringBuffer();
                buf.append(ch);
                while ((ch = peekChar()) != -1
                        && Character.isJavaIdentifierPart(ch)) {
                    buf.append(ch);
                    nextChar();
                }
                return new Id(buf.toString());
            }

            if (ch == '\'' || ch == '"') {
                return parseQuotedChars(ch);
            } else {
                // For now...
                return new Char(ch);
            }
        }
        return null;
    }
254587
public String getResumptionToken()
    {
        String resumptionToken = null;
    
        try
        {
            if (data != null && data.has(resumptionTokenParam))
            {
                resumptionToken = data.getString(resumptionTokenParam);
            }
        }
        catch (JSONException e)
        {
            //This is already handled by the enclosing "has" checks
        }
        
        return resumptionToken;
    }
590878
public String nextToken() {
        /*
         * If next position already computed in hasMoreElements() and
         * delimiters have changed between the computation and this invocation,
         * then use the computed value.
         */

        currentPosition = (newPosition >= 0 && !delimsChanged) ?
            newPosition : skipDelimiters(currentPosition);

        /* Reset these anyway */
        delimsChanged = false;
        newPosition = -1;

        if (currentPosition >= maxPosition)
            throw new NoSuchElementException();
        int start = currentPosition;
        currentPosition = scanToken(currentPosition);
        return str.substring(start, currentPosition);
    }
589470
public final String getProxyScript() {
        StringBuilder buf = new StringBuilder("makeStaplerProxy('").append(getURL()).append("','").append(
                WebApp.getCurrent().getCrumbIssuer().issueCrumb()
        ).append("',[");

        boolean first=true;
        for (Method m : getTarget().getClass().getMethods()) {
            Collection<String> names;
            if (m.getName().startsWith("js")) {
                names = Collections.singleton(camelize(m.getName().substring(2)));
            } else {
                JavaScriptMethod a = m.getAnnotation(JavaScriptMethod.class);
                if (a!=null) {
                    names = Arrays.asList(a.name());
                    if (names.isEmpty())
                        names = Collections.singleton(m.getName());
                } else
                    continue;
            }

            for (String n : names) {
                if (first)  first = false;
                else        buf.append(',');
                buf.append('\'').append(n).append('\'');
            }
        }
        buf.append("])");
        
        return buf.toString();
    }
1100332
protected Content getFramesJavaScript() {
        HtmlTree scriptTree = HtmlTree.SCRIPT();
        String scriptCode = "\n" +
                "    tmpTargetPage = \"\" + window.location.search;\n" +
                "    if (tmpTargetPage != \"\" && tmpTargetPage != \"undefined\")\n" +
                "        tmpTargetPage = tmpTargetPage.substring(1);\n" +
                "    if (tmpTargetPage.indexOf(\":\") != -1 || (tmpTargetPage != \"\" && !validURL(tmpTargetPage)))\n" +
                "        tmpTargetPage = \"undefined\";\n" +
                "    targetPage = tmpTargetPage;\n" +
                "    function validURL(url) {\n" +
                "        try {\n" +
                "            url = decodeURIComponent(url);\n" +
                "        }\n" +
                "        catch (error) {\n" +
                "            return false;\n" +
                "        }\n" +
                "        var pos = url.indexOf(\".html\");\n" +
                "        if (pos == -1 || pos != url.length - 5)\n" +
                "            return false;\n" +
                "        var allowNumber = false;\n" +
                "        var allowSep = false;\n" +
                "        var seenDot = false;\n" +
                "        for (var i = 0; i < url.length - 5; i++) {\n" +
                "            var ch = url.charAt(i);\n" +
                "            if ('a' <= ch && ch <= 'z' ||\n" +
                "                    'A' <= ch && ch <= 'Z' ||\n" +
                "                    ch == '$' ||\n" +
                "                    ch == '_' ||\n" +
                "                    ch.charCodeAt(0) > 127) {\n" +
                "                allowNumber = true;\n" +
                "                allowSep = true;\n" +
                "            } else if ('0' <= ch && ch <= '9'\n" +
                "                    || ch == '-') {\n" +
                "                if (!allowNumber)\n" +
                "                     return false;\n" +
                "            } else if (ch == '/' || ch == '.') {\n" +
                "                if (!allowSep)\n" +
                "                    return false;\n" +
                "                allowNumber = false;\n" +
                "                allowSep = false;\n" +
                "                if (ch == '.')\n" +
                "                     seenDot = true;\n" +
                "                if (ch == '/' && seenDot)\n" +
                "                     return false;\n" +
                "            } else {\n" +
                "                return false;\n" +
                "            }\n" +
                "        }\n" +
                "        return true;\n" +
                "    }\n" +
                "    function loadFrames() {\n" +
                "        if (targetPage != \"\" && targetPage != \"undefined\")\n" +
                "             top.classFrame.location = top.targetPage;\n" +
                "    }\n";
        RawHtml scriptContent = new RawHtml(scriptCode.replace("\n", DocletConstants.NL));
        scriptTree.addContent(scriptContent);
        return scriptTree;
    }
881152
function() {
    if (this.isSelectorToken(1)) {
      if ('{' == this.peek().type) {
        // unclosed, must be a block
        if (!this.lineContains('}')) return;
        // check if ':' is within the braces.
        // though not required by Stylus, chances
        // are if someone is using {} they will
        // use CSS-style props, helping us with
        // the ambiguity in this case
        var i = 0
          , la;
        while (la = this.lookahead(++i)) {
          if ('}' == la.type) {
            // Check empty block.
            if (i == 2 || (i == 3 && this.lookahead(i - 1).type == 'space'))
              return;
            break;
          }
          if (':' == la.type) return;
        }
      }
      return this.next();
    }
  }
615982
function getToken() {
  tokenType = TOKENTYPE.NULL;
  token = '';

  // skip over whitespaces: space, tab, newline, and carriage return
  while (c === ' ' || c === '\t' || c === '\n' || c === '\r') {
    next();
  }

  // check for delimiters
  if (DELIMITERS[c]) {
    tokenType = TOKENTYPE.DELIMITER;
    token = c;
    next();
    return;
  }

  // check for a number
  if (isDigit(c) || c === '-') {
    tokenType = TOKENTYPE.NUMBER;

    if (c === '-') {
      token += c;
      next();

      if (!isDigit(c)) {
        throw createSyntaxError('Invalid number, digit expected', index);
      }
    }
    else if (c === '0') {
      token += c;
      next();
    }
    else {
      // digit 1-9, nothing extra to do
    }

    while (isDigit(c)) {
      token += c;
      next();
    }

    if (c === '.') {
      token += c;
      next();

      if (!isDigit(c)) {
        throw createSyntaxError('Invalid number, digit expected', index);
      }

      while (isDigit(c)) {
        token += c;
        next();
      }
    }

    if (c === 'e' || c === 'E') {
      token += c;
      next();

      if (c === '+' || c === '-') {
        token += c;
        next();
      }

      if (!isDigit(c)) {
        throw createSyntaxError('Invalid number, digit expected', index);
      }

      while (isDigit(c)) {
        token += c;
        next();
      }
    }

    return;
  }

  // check for a string
  if (c === '"') {
    tokenType = TOKENTYPE.STRING;
    next();

    while (c !== '' && c !== '"') {

      if (c === '\\') {
        // handle escape characters
        next();

        let unescaped = ESCAPE_CHARACTERS[c];
        if (unescaped !== undefined) {
          token += unescaped;
          next();
        }
        else if (c === 'u') {
          // parse escaped unicode character, like '\\u260E'
          next();

          let hex = '';
          for (let u = 0; u < 4; u++) {
            if (!isHex(c)) {
              throw createSyntaxError('Invalid unicode character');
            }
            hex += c;
            next();
          }

          token += String.fromCharCode(parseInt(hex, 16));
        }
        else {
          throw createSyntaxError('Invalid escape character "\\' + c + '"', index);
        }
      }
      else {
        // a regular character
        token += c;
        next();
      }
    }

    if (c !== '"') {
      throw createSyntaxError('End of string expected');
    }
    next();

    return;
  }

  // check for symbols (true, false, null)
  if (isAlpha(c)) {
    tokenType = TOKENTYPE.SYMBOL;

    while (isAlpha(c)) {
      token += c;
      next();
    }

    return;
  }

  // something unknown is found, wrong characters -> a syntax error
  tokenType = TOKENTYPE.UNKNOWN;
  while (c !== '') {
    token += c;
    next();
  }
  throw createSyntaxError('Syntax error in part "' + token + '"');
}
924900
public RecordId getTailSolt() {
		Constant blkNum = getVal(OFFSET_TS_BLOCKID, BIGINT);
		Constant rid = getVal(OFFSET_TS_RID, INTEGER);
		BlockId bid = new BlockId(fileName, (Long) blkNum.asJavaVal());
		return new RecordId(bid, (Integer) rid.asJavaVal());
	}