Package org.glassfish.grizzly.http.util

Examples of org.glassfish.grizzly.http.util.DataChunk.indexOf()


        // we only care about q=0/q=0.0.  If present, the user-agent
        // doesn't support this particular compression.
        int qvalueStart = acceptEncodingDC.indexOf(';', idx + alias.length());
        if (qvalueStart != -1) {
            qvalueStart = acceptEncodingDC.indexOf('=', qvalueStart);
            final int commaIdx = acceptEncodingDC.indexOf(',', qvalueStart);
            final int qvalueEnd = commaIdx != -1 ? commaIdx : acceptEncodingDC.getLength();
            if (HttpUtils.convertQValueToFloat(acceptEncodingDC,
                    qvalueStart + 1,
                    qvalueEnd) == 0.0f) {
                return false;
View Full Code Here


            final List<ContentEncoding> encodings = httpHeader.getContentEncodings(true);
            int currentIdx = 0;

            int commaIdx;
            do {
                commaIdx = bc.indexOf(',', currentIdx);
                final ContentEncoding ce = lookupContentEncoding(bc, currentIdx,
                        commaIdx >= 0 ? commaIdx : bc.getLength());
                if (ce != null && ce.wantDecode(httpHeader)) {
                    encodings.add(0, ce);
                } else {
View Full Code Here

       
        final DataChunk uriBC = request.getRequestURIRef().getRequestURIBC();
       
        if (uriBC.startsWithIgnoreCase("http", 0)) {

            int pos = uriBC.indexOf("://", 4);
            int uriBCStart = uriBC.getStart();
            int slashPos;
            if (pos != -1) {
//                final Buffer uriB = uriBC.getBuffer();
                slashPos = uriBC.indexOf('/', pos + 3);
View Full Code Here

            int pos = uriBC.indexOf("://", 4);
            int uriBCStart = uriBC.getStart();
            int slashPos;
            if (pos != -1) {
//                final Buffer uriB = uriBC.getBuffer();
                slashPos = uriBC.indexOf('/', pos + 3);
                if (slashPos == -1) {
                    slashPos = uriBC.getLength();
                    // Set URI as "/"
                    uriBC.setStart(uriBCStart + pos + 1);
                    uriBC.setEnd(uriBCStart + pos + 2);
View Full Code Here

            final List<ContentEncoding> encodings = httpHeader.getContentEncodings(true);
            int currentIdx = 0;

            int commaIdx;
            do {
                commaIdx = bc.indexOf(',', currentIdx);
                final ContentEncoding ce = lookupContentEncoding(bc, currentIdx,
                        commaIdx >= 0 ? commaIdx : bc.getLength());
                if (ce != null && ce.wantDecode(httpHeader)) {
                    encodings.add(0, ce);
                } else {
View Full Code Here

                final RequestURIRef uriRef = request.getRequest().getRequestURIRef();
                uriRef.setDefaultURIEncoding(httpHandler.getRequestURIEncoding());
                final DataChunk decodedURI = uriRef.getDecodedRequestURIBC(
                        httpHandler.isAllowEncodedSlash());
               
                final int pos = decodedURI.indexOf(';', 0);
                return pos < 0 ? decodedURI.toString() : decodedURI.toString(0, pos);
            } catch (CharConversionException e) {
                throw new IllegalStateException(e);
            }
        }
View Full Code Here

        final DataChunk uriBC =
                coyoteRequest.getRequest().getRequestURIRef().getRequestURIBC();
       
//        start = uriBC.getStart();
//        end = uriBC.getEnd();
        semicolon = uriBC.indexOf(parameter, 0);

        if (semicolon > 0) {
            semicolon2 = uriBC.indexOf(';', semicolon + parameter.length());

            final int end;
View Full Code Here

//        start = uriBC.getStart();
//        end = uriBC.getEnd();
        semicolon = uriBC.indexOf(parameter, 0);

        if (semicolon > 0) {
            semicolon2 = uriBC.indexOf(';', semicolon + parameter.length());

            final int end;
            if (semicolon2 >= 0) {
                end = semicolon2;
                uriBC.notifyDirectUpdate();
View Full Code Here

    public boolean applyDecoding(HttpHeader httpPacket) {

        final HttpResponsePacket httpResponse = (HttpResponsePacket) httpPacket;
        final DataChunk bc = httpResponse.getHeaders().getValue(Header.ContentEncoding);
        return bc != null && bc.indexOf("gzip", 0) != -1;
    }
}
View Full Code Here

        final DataChunk uriBC =
                coyoteRequest.getRequest().getRequestURIRef().getRequestURIBC();
       
//        start = uriBC.getStart();
//        end = uriBC.getEnd();
        semicolon = uriBC.indexOf(parameter, 0);

        if (semicolon > 0) {
            semicolon2 = uriBC.indexOf(';', semicolon + parameter.length());

            final int end;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.