当前位置: 首页>>代码示例>>Java>>正文


Java CharChunk.setEnd方法代码示例

本文整理汇总了Java中org.apache.tomcat.util.buf.CharChunk.setEnd方法的典型用法代码示例。如果您正苦于以下问题:Java CharChunk.setEnd方法的具体用法?Java CharChunk.setEnd怎么用?Java CharChunk.setEnd使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.tomcat.util.buf.CharChunk的用法示例。


在下文中一共展示了CharChunk.setEnd方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: internalMapExtensionWrapper

import org.apache.tomcat.util.buf.CharChunk; //导入方法依赖的package包/类
/**
 * Extension mappings.
 *
 * @param wrappers          Set of wrappers to check for matches
 * @param path              Path to map
 * @param mappingData       Mapping data for result
 * @param resourceExpected  Is this mapping expecting to find a resource
 */
private final void internalMapExtensionWrapper(Wrapper[] wrappers,
        CharChunk path, MappingData mappingData, boolean resourceExpected) {
    char[] buf = path.getBuffer();
    int pathEnd = path.getEnd();
    int servletPath = path.getOffset();
    int slash = -1;
    for (int i = pathEnd - 1; i >= servletPath; i--) {
        if (buf[i] == '/') {
            slash = i;
            break;
        }
    }
    if (slash >= 0) {
        int period = -1;
        for (int i = pathEnd - 1; i > slash; i--) {
            if (buf[i] == '.') {
                period = i;
                break;
            }
        }
        if (period >= 0) {
            path.setOffset(period + 1);
            path.setEnd(pathEnd);
            Wrapper wrapper = exactFind(wrappers, path);
            if (wrapper != null
                    && (resourceExpected || !wrapper.resourceOnly)) {
                mappingData.wrapperPath.setChars(buf, servletPath, pathEnd
                        - servletPath);
                mappingData.requestPath.setChars(buf, servletPath, pathEnd
                        - servletPath);
                mappingData.wrapper = wrapper.object;
            }
            path.setOffset(servletPath);
            path.setEnd(pathEnd);
        }
    }
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:46,代码来源:Mapper.java

示例2: for

import org.apache.tomcat.util.buf.CharChunk; //导入方法依赖的package包/类
/**
 * Extension mappings.
 */
private final void internalMapExtensionWrapper
    (Wrapper[] wrappers, CharChunk path, MappingData mappingData) {
    char[] buf = path.getBuffer();
    int pathEnd = path.getEnd();
    int servletPath = path.getOffset();
    int slash = -1;
    for (int i = pathEnd - 1; i >= servletPath; i--) {
        if (buf[i] == '/') {
            slash = i;
            break;
        }
    }
    if (slash >= 0) {
        int period = -1;
        for (int i = pathEnd - 1; i > slash; i--) {
            if (buf[i] == '.') {
                period = i;
                break;
            }
        }
        if (period >= 0) {
            path.setOffset(period + 1);
            path.setEnd(pathEnd);
            int pos = find(wrappers, path);
            if ((pos != -1)
                && (path.equals(wrappers[pos].name))) {
                mappingData.wrapperPath.setChars
                    (buf, servletPath, pathEnd - servletPath);
                mappingData.requestPath.setChars
                    (buf, servletPath, pathEnd - servletPath);
                mappingData.wrapper = wrappers[pos].object;
            }
            path.setOffset(servletPath);
            path.setEnd(pathEnd);
        }
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:41,代码来源:Mapper.java

示例3: internalMapExtensionWrapper

import org.apache.tomcat.util.buf.CharChunk; //导入方法依赖的package包/类
/**
 * Extension mappings.
 *
 * @param wrappers
 *            Set of wrappers to check for matches
 * @param path
 *            Path to map
 * @param mappingData
 *            Mapping data for result
 * @param resourceExpected
 *            Is this mapping expecting to find a resource
 */
private final void internalMapExtensionWrapper(Wrapper[] wrappers, CharChunk path, MappingData mappingData,
		boolean resourceExpected) {
	char[] buf = path.getBuffer();
	int pathEnd = path.getEnd();
	int servletPath = path.getOffset();
	int slash = -1;
	for (int i = pathEnd - 1; i >= servletPath; i--) {
		if (buf[i] == '/') {
			slash = i;
			break;
		}
	}
	if (slash >= 0) {
		int period = -1;
		for (int i = pathEnd - 1; i > slash; i--) {
			if (buf[i] == '.') {
				period = i;
				break;
			}
		}
		if (period >= 0) {
			path.setOffset(period + 1);
			path.setEnd(pathEnd);
			Wrapper wrapper = exactFind(wrappers, path);
			if (wrapper != null && (resourceExpected || !wrapper.resourceOnly)) {
				mappingData.wrapperPath.setChars(buf, servletPath, pathEnd - servletPath);
				mappingData.requestPath.setChars(buf, servletPath, pathEnd - servletPath);
				mappingData.wrapper = wrapper.object;
			}
			path.setOffset(servletPath);
			path.setEnd(pathEnd);
		}
	}
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:47,代码来源:Mapper.java

示例4: internalMapExtensionWrapper

import org.apache.tomcat.util.buf.CharChunk; //导入方法依赖的package包/类
/**
 * Extension mappings.
 *
 * @param wrappers          Set of wrappers to check for matches
 * @param path              Path to map
 * @param mappingData       Mapping data for result
 * @param resourceExpected  Is this mapping expecting to find a resource
 */
private final void internalMapExtensionWrapper(Wrapper[] wrappers,
        CharChunk path, MappingData mappingData, boolean resourceExpected) {
    char[] buf = path.getBuffer();
    int pathEnd = path.getEnd();
    int servletPath = path.getOffset();
    int slash = -1;
    for (int i = pathEnd - 1; i >= servletPath; i--) {
        if (buf[i] == '/') {
            slash = i;
            break;
        }
    }
    if (slash >= 0) {
        int period = -1;
        for (int i = pathEnd - 1; i > slash; i--) {
            if (buf[i] == '.') {
                period = i;
                break;
            }
        }
        if (period >= 0) {
            path.setOffset(period + 1);
            path.setEnd(pathEnd);
            int pos = find(wrappers, path);
            if ((pos != -1) && (path.equals(wrappers[pos].name)) &&
                    (resourceExpected || !wrappers[pos].resourceOnly)) {
                mappingData.wrapperPath.setChars
                    (buf, servletPath, pathEnd - servletPath);
                mappingData.requestPath.setChars
                    (buf, servletPath, pathEnd - servletPath);
                mappingData.wrapper = wrappers[pos].object;
            }
            path.setOffset(servletPath);
            path.setEnd(pathEnd);
        }
    }
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:46,代码来源:Mapper.java

示例5: internalMapExtensionWrapper

import org.apache.tomcat.util.buf.CharChunk; //导入方法依赖的package包/类
/**
 * Extension mappings.
 * 
 * @param wrappers          Set of wrappers to check for matches
 * @param path              Path to map
 * @param mappingData       Mapping data for result
 * @param resourceExpected  Is this mapping expecting to find a resource
 */
private final void internalMapExtensionWrapper(Wrapper[] wrappers,
        CharChunk path, MappingData mappingData, boolean resourceExpected) {
    char[] buf = path.getBuffer();
    int pathEnd = path.getEnd();
    int servletPath = path.getOffset();
    int slash = -1;
    for (int i = pathEnd - 1; i >= servletPath; i--) {
        if (buf[i] == '/') {
            slash = i;
            break;
        }
    }
    if (slash >= 0) {
        int period = -1;
        for (int i = pathEnd - 1; i > slash; i--) {
            if (buf[i] == '.') {
                period = i;
                break;
            }
        }
        if (period >= 0) {
            path.setOffset(period + 1);
            path.setEnd(pathEnd);
            int pos = find(wrappers, path);
            if ((pos != -1) && (path.equals(wrappers[pos].name)) &&
                    (resourceExpected || !wrappers[pos].resourceOnly)) {
                mappingData.wrapperPath.setChars
                    (buf, servletPath, pathEnd - servletPath);
                mappingData.requestPath.setChars
                    (buf, servletPath, pathEnd - servletPath);
                mappingData.wrapper = wrappers[pos].object;
            }
            path.setOffset(servletPath);
            path.setEnd(pathEnd);
        }
    }
}
 
开发者ID:WhiteBearSolutions,项目名称:WBSAirback,代码行数:46,代码来源:Mapper.java

示例6: decode

import org.apache.tomcat.util.buf.CharChunk; //导入方法依赖的package包/类
/**
 * Decodes Base64 data into octets
 *
 * @param base64DataBC Byte array containing Base64 data
 * @param decodedDataCC The decoded data chars
 */
public static void decode( ByteChunk base64DataBC, CharChunk decodedDataCC)
{
    int start = base64DataBC.getStart();
    int end = base64DataBC.getEnd();
    byte[] base64Data = base64DataBC.getBuffer();
    
    decodedDataCC.recycle();
    
    // handle the edge case, so we don't have to worry about it later
    if(end - start == 0) { return; }

    int      numberQuadruple    = (end - start)/FOURBYTE;
    byte     b1=0,b2=0,b3=0, b4=0, marker0=0, marker1=0;

    // Throw away anything not in base64Data

    int encodedIndex = 0;
    int dataIndex = start;
    char[] decodedData = null;
    
    {
        // this sizes the output array properly - rlw
        int lastData = end - start;
        // ignore the '=' padding
        while (base64Data[start+lastData-1] == PAD)
        {
            if (--lastData == 0)
            {
                return;
            }
        }
        decodedDataCC.allocate(lastData - numberQuadruple, -1);
        decodedDataCC.setEnd(lastData - numberQuadruple);
        decodedData = decodedDataCC.getBuffer();
    }

    for (int i = 0; i < numberQuadruple; i++)
    {
        dataIndex = start + i * 4;
        marker0   = base64Data[dataIndex + 2];
        marker1   = base64Data[dataIndex + 3];

        b1 = base64Alphabet[base64Data[dataIndex]];
        b2 = base64Alphabet[base64Data[dataIndex +1]];

        if (marker0 != PAD && marker1 != PAD)
        {
            //No PAD e.g 3cQl
            b3 = base64Alphabet[ marker0 ];
            b4 = base64Alphabet[ marker1 ];

            decodedData[encodedIndex]   = (char) ((  b1 <<2 | b2>>4 ) & 0xff);
            decodedData[encodedIndex + 1] =
                (char) ((((b2 & 0xf)<<4 ) |( (b3>>2) & 0xf) ) & 0xff);
            decodedData[encodedIndex + 2] = (char) (( b3<<6 | b4 ) & 0xff);
        }
        else if (marker0 == PAD)
        {
            //Two PAD e.g. 3c[Pad][Pad]
            decodedData[encodedIndex]   = (char) ((  b1 <<2 | b2>>4 ) & 0xff);
        }
        else if (marker1 == PAD)
        {
            //One PAD e.g. 3cQ[Pad]
            b3 = base64Alphabet[ marker0 ];

            decodedData[encodedIndex]   = (char) ((  b1 <<2 | b2>>4 ) & 0xff);
            decodedData[encodedIndex + 1] =
                (char) ((((b2 & 0xf)<<4 ) |( (b3>>2) & 0xf) ) & 0xff);
        }
        encodedIndex += 3;
    }
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:80,代码来源:Base64.java

示例7: find

import org.apache.tomcat.util.buf.CharChunk; //导入方法依赖的package包/类
/**
 * Wildcard mapping.
 */
private final void internalMapWildcardWrapper
    (Wrapper[] wrappers, int nesting, CharChunk path,
     MappingData mappingData) {

    int pathEnd = path.getEnd();

    int lastSlash = -1;
    int length = -1;
    int pos = find(wrappers, path);
    if (pos != -1) {
        boolean found = false;
        while (pos >= 0) {
            if (path.startsWith(wrappers[pos].name)) {
                length = wrappers[pos].name.length();
                if (path.getLength() == length) {
                    found = true;
                    break;
                } else if (path.startsWithIgnoreCase("/", length)) {
                    found = true;
                    break;
                }
            }
            if (lastSlash == -1) {
                lastSlash = nthSlash(path, nesting + 1);
            } else {
                lastSlash = lastSlash(path);
            }
            path.setEnd(lastSlash);
            pos = find(wrappers, path);
        }
        path.setEnd(pathEnd);
        if (found) {
            mappingData.wrapperPath.setString(wrappers[pos].name);
            if (path.getLength() > length) {
                mappingData.pathInfo.setChars
                    (path.getBuffer(),
                     path.getOffset() + length,
                     path.getLength() - length);
            }
            mappingData.requestPath.setChars
                (path.getBuffer(), path.getOffset(), path.getLength());
            mappingData.wrapper = wrappers[pos].object;
            mappingData.jspWildCard = wrappers[pos].jspWildCard;
        }
    }
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:50,代码来源:Mapper.java

示例8: decode

import org.apache.tomcat.util.buf.CharChunk; //导入方法依赖的package包/类
/**
 * Decodes Base64 data into octects
 *
 * @param base64DataBC Byte array containing Base64 data
 * @param decodedDataCC The decoded data chars
 */
public static void decode( ByteChunk base64DataBC, CharChunk decodedDataCC)
{
    int start = base64DataBC.getStart();
    int end = base64DataBC.getEnd();
    byte[] base64Data = base64DataBC.getBuffer();
    
    decodedDataCC.recycle();
    
    // handle the edge case, so we don't have to worry about it later
    if(end - start == 0) { return; }

    int      numberQuadruple    = (end - start)/FOURBYTE;
    byte     b1=0,b2=0,b3=0, b4=0, marker0=0, marker1=0;

    // Throw away anything not in base64Data

    int encodedIndex = 0;
    int dataIndex = start;
    char[] decodedData = null;
    
    {
        // this sizes the output array properly - rlw
        int lastData = end - start;
        // ignore the '=' padding
        while (base64Data[start+lastData-1] == PAD)
        {
            if (--lastData == 0)
            {
                return;
            }
        }
        decodedDataCC.allocate(lastData - numberQuadruple, -1);
        decodedDataCC.setEnd(lastData - numberQuadruple);
        decodedData = decodedDataCC.getBuffer();
    }

    for (int i = 0; i < numberQuadruple; i++)
    {
        dataIndex = start + i * 4;
        marker0   = base64Data[dataIndex + 2];
        marker1   = base64Data[dataIndex + 3];

        b1 = base64Alphabet[base64Data[dataIndex]];
        b2 = base64Alphabet[base64Data[dataIndex +1]];

        if (marker0 != PAD && marker1 != PAD)
        {
            //No PAD e.g 3cQl
            b3 = base64Alphabet[ marker0 ];
            b4 = base64Alphabet[ marker1 ];

            decodedData[encodedIndex]   = (char) ((  b1 <<2 | b2>>4 ) & 0xff);
            decodedData[encodedIndex + 1] =
                (char) ((((b2 & 0xf)<<4 ) |( (b3>>2) & 0xf) ) & 0xff);
            decodedData[encodedIndex + 2] = (char) (( b3<<6 | b4 ) & 0xff);
        }
        else if (marker0 == PAD)
        {
            //Two PAD e.g. 3c[Pad][Pad]
            decodedData[encodedIndex]   = (char) ((  b1 <<2 | b2>>4 ) & 0xff);
        }
        else if (marker1 == PAD)
        {
            //One PAD e.g. 3cQ[Pad]
            b3 = base64Alphabet[ marker0 ];

            decodedData[encodedIndex]   = (char) ((  b1 <<2 | b2>>4 ) & 0xff);
            decodedData[encodedIndex + 1] =
                (char) ((((b2 & 0xf)<<4 ) |( (b3>>2) & 0xf) ) & 0xff);
        }
        encodedIndex += 3;
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:80,代码来源:Base64.java

示例9: find

import org.apache.tomcat.util.buf.CharChunk; //导入方法依赖的package包/类
/**
 * Wildcard mapping.
 */
private final void internalMapWildcardWrapper
    (Wrapper[] wrappers, int nesting, CharChunk path, 
     MappingData mappingData) {

    int pathEnd = path.getEnd();
    int pathOffset = path.getOffset();

    int lastSlash = -1;
    int length = -1;
    int pos = find(wrappers, path);
    if (pos != -1) {
        boolean found = false;
        while (pos >= 0) {
            if (path.startsWith(wrappers[pos].name)) {
                length = wrappers[pos].name.length();
                if (path.getLength() == length) {
                    found = true;
                    break;
                } else if (path.startsWithIgnoreCase("/", length)) {
                    found = true;
                    break;
                }
            }
            if (lastSlash == -1) {
                lastSlash = nthSlash(path, nesting + 1);
            } else {
                lastSlash = lastSlash(path);
            }
            path.setEnd(lastSlash);
            pos = find(wrappers, path);
        }
        path.setEnd(pathEnd);
        if (found) {
            mappingData.wrapperPath.setString(wrappers[pos].name);
            if (path.getLength() > length) {
                mappingData.pathInfo.setChars
                    (path.getBuffer(),
                     path.getOffset() + length,
                     path.getLength() - length);
            }
            mappingData.requestPath.setChars
                (path.getBuffer(), path.getOffset(), path.getLength());
            mappingData.wrapper = wrappers[pos].object;
            mappingData.jspWildCard = wrappers[pos].jspWildCard;
        }
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:51,代码来源:Mapper.java

示例10: normalize

import org.apache.tomcat.util.buf.CharChunk; //导入方法依赖的package包/类
private void normalize(CharChunk cc) {
	// Strip query string and/or fragment first as doing it this way makes
	// the normalization logic a lot simpler
	int truncate = cc.indexOf('?');
	if (truncate == -1) {
		truncate = cc.indexOf('#');
	}
	char[] truncateCC = null;
	if (truncate > -1) {
		truncateCC = Arrays.copyOfRange(cc.getBuffer(), cc.getStart() + truncate, cc.getEnd());
		cc.setEnd(cc.getStart() + truncate);
	}

	if (cc.endsWith("/.") || cc.endsWith("/..")) {
		try {
			cc.append('/');
		} catch (IOException e) {
			throw new IllegalArgumentException(cc.toString(), e);
		}
	}

	char[] c = cc.getChars();
	int start = cc.getStart();
	int end = cc.getEnd();
	int index = 0;
	int startIndex = 0;

	// Advance past the first three / characters (should place index just
	// scheme://host[:port]

	for (int i = 0; i < 3; i++) {
		startIndex = cc.indexOf('/', startIndex + 1);
	}

	// Remove /./
	index = startIndex;
	while (true) {
		index = cc.indexOf("/./", 0, 3, index);
		if (index < 0) {
			break;
		}
		copyChars(c, start + index, start + index + 2, end - start - index - 2);
		end = end - 2;
		cc.setEnd(end);
	}

	// Remove /../
	index = startIndex;
	int pos;
	while (true) {
		index = cc.indexOf("/../", 0, 4, index);
		if (index < 0) {
			break;
		}
		// Can't go above the server root
		if (index == startIndex) {
			throw new IllegalArgumentException();
		}
		int index2 = -1;
		for (pos = start + index - 1; (pos >= 0) && (index2 < 0); pos--) {
			if (c[pos] == (byte) '/') {
				index2 = pos;
			}
		}
		copyChars(c, start + index2, start + index + 3, end - start - index - 3);
		end = end + index2 - index - 3;
		cc.setEnd(end);
		index = index2;
	}

	// Add the query string and/or fragment (if present) back in
	if (truncateCC != null) {
		try {
			cc.append(truncateCC, 0, truncateCC.length);
		} catch (IOException ioe) {
			throw new IllegalArgumentException(ioe);
		}
	}
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:80,代码来源:Response.java

示例11: decode

import org.apache.tomcat.util.buf.CharChunk; //导入方法依赖的package包/类
/**
 * Decodes Base64 data into octets
 *
 * @param base64DataBC
 *            Byte array containing Base64 data
 * @param decodedDataCC
 *            The decoded data chars
 */
public static void decode(ByteChunk base64DataBC, CharChunk decodedDataCC) {
	int start = base64DataBC.getStart();
	int end = base64DataBC.getEnd();
	byte[] base64Data = base64DataBC.getBuffer();

	decodedDataCC.recycle();

	// handle the edge case, so we don't have to worry about it later
	if (end - start == 0) {
		return;
	}

	int numberQuadruple = (end - start) / FOURBYTE;
	byte b1 = 0, b2 = 0, b3 = 0, b4 = 0, marker0 = 0, marker1 = 0;

	// Throw away anything not in base64Data

	int encodedIndex = 0;
	int dataIndex = start;
	char[] decodedData = null;

	{
		// this sizes the output array properly - rlw
		int lastData = end - start;
		// ignore the '=' padding
		while (base64Data[start + lastData - 1] == PAD) {
			if (--lastData == 0) {
				return;
			}
		}
		decodedDataCC.allocate(lastData - numberQuadruple, -1);
		decodedDataCC.setEnd(lastData - numberQuadruple);
		decodedData = decodedDataCC.getBuffer();
	}

	for (int i = 0; i < numberQuadruple; i++) {
		dataIndex = start + i * 4;
		marker0 = base64Data[dataIndex + 2];
		marker1 = base64Data[dataIndex + 3];

		b1 = base64Alphabet[base64Data[dataIndex]];
		b2 = base64Alphabet[base64Data[dataIndex + 1]];

		if (marker0 != PAD && marker1 != PAD) {
			// No PAD e.g 3cQl
			b3 = base64Alphabet[marker0];
			b4 = base64Alphabet[marker1];

			decodedData[encodedIndex] = (char) ((b1 << 2 | b2 >> 4) & 0xff);
			decodedData[encodedIndex + 1] = (char) ((((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf)) & 0xff);
			decodedData[encodedIndex + 2] = (char) ((b3 << 6 | b4) & 0xff);
		} else if (marker0 == PAD) {
			// Two PAD e.g. 3c[Pad][Pad]
			decodedData[encodedIndex] = (char) ((b1 << 2 | b2 >> 4) & 0xff);
		} else if (marker1 == PAD) {
			// One PAD e.g. 3cQ[Pad]
			b3 = base64Alphabet[marker0];

			decodedData[encodedIndex] = (char) ((b1 << 2 | b2 >> 4) & 0xff);
			decodedData[encodedIndex + 1] = (char) ((((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf)) & 0xff);
		}
		encodedIndex += 3;
	}
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:73,代码来源:Base64.java

示例12: internalMapWildcardWrapper

import org.apache.tomcat.util.buf.CharChunk; //导入方法依赖的package包/类
/**
 * Wildcard mapping.
 */
private final void internalMapWildcardWrapper(Wrapper[] wrappers, int nesting, CharChunk path,
		MappingData mappingData) {

	int pathEnd = path.getEnd();

	int lastSlash = -1;
	int length = -1;
	int pos = find(wrappers, path);
	if (pos != -1) {
		boolean found = false;
		while (pos >= 0) {
			if (path.startsWith(wrappers[pos].name)) {
				length = wrappers[pos].name.length();
				if (path.getLength() == length) {
					found = true;
					break;
				} else if (path.startsWithIgnoreCase("/", length)) {
					found = true;
					break;
				}
			}
			if (lastSlash == -1) {
				lastSlash = nthSlash(path, nesting + 1);
			} else {
				lastSlash = lastSlash(path);
			}
			path.setEnd(lastSlash);
			pos = find(wrappers, path);
		}
		path.setEnd(pathEnd);
		if (found) {
			mappingData.wrapperPath.setString(wrappers[pos].name);
			if (path.getLength() > length) {
				mappingData.pathInfo.setChars(path.getBuffer(), path.getOffset() + length,
						path.getLength() - length);
			}
			mappingData.requestPath.setChars(path.getBuffer(), path.getOffset(), path.getLength());
			mappingData.wrapper = wrappers[pos].object;
			mappingData.jspWildCard = wrappers[pos].jspWildCard;
		}
	}
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:46,代码来源:Mapper.java

示例13: find

import org.apache.tomcat.util.buf.CharChunk; //导入方法依赖的package包/类
/**
 * Wildcard mapping.
 */
private final void internalMapWildcardWrapper
    (Wrapper[] wrappers, int nesting, CharChunk path, 
     MappingData mappingData) {

    int pathEnd = path.getEnd();

    int lastSlash = -1;
    int length = -1;
    int pos = find(wrappers, path);
    if (pos != -1) {
        boolean found = false;
        while (pos >= 0) {
            if (path.startsWith(wrappers[pos].name)) {
                length = wrappers[pos].name.length();
                if (path.getLength() == length) {
                    found = true;
                    break;
                } else if (path.startsWithIgnoreCase("/", length)) {
                    found = true;
                    break;
                }
            }
            if (lastSlash == -1) {
                lastSlash = nthSlash(path, nesting + 1);
            } else {
                lastSlash = lastSlash(path);
            }
            path.setEnd(lastSlash);
            pos = find(wrappers, path);
        }
        path.setEnd(pathEnd);
        if (found) {
            mappingData.wrapperPath.setString(wrappers[pos].name);
            if (path.getLength() > length) {
                mappingData.pathInfo.setChars
                    (path.getBuffer(),
                     path.getOffset() + length,
                     path.getLength() - length);
            }
            mappingData.requestPath.setChars
                (path.getBuffer(), path.getOffset(), path.getLength());
            mappingData.wrapper = wrappers[pos].object;
            mappingData.jspWildCard = wrappers[pos].jspWildCard;
        }
    }
}
 
开发者ID:WhiteBearSolutions,项目名称:WBSAirback,代码行数:50,代码来源:Mapper.java


注:本文中的org.apache.tomcat.util.buf.CharChunk.setEnd方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。