Refine search
int indexFrom = cursor.getPos(); int indexTo = cursor.getUpperBound(); skipWhitespace(buffer, cursor); int i = cursor.getPos(); String method = buffer.substringTrimmed(i, blank); cursor.updatePos(blank); skipWhitespace(buffer, cursor); i = cursor.getPos(); cursor.updatePos(blank); ProtocolVersion ver = parseProtocolVersion(buffer, cursor); skipWhitespace(buffer, cursor); if (!cursor.atEnd()) { throw new ParseException("Invalid request line: " + buffer.substring(indexFrom, indexTo)); return createRequestLine(method, uri, ver); } catch (IndexOutOfBoundsException e) { throw new ParseException("Invalid request line: " +
final int protolength = protoname.length(); int indexFrom = cursor.getPos(); int indexTo = cursor.getUpperBound(); skipWhitespace(buffer, cursor); int i = cursor.getPos(); throw new ParseException ("Not a valid protocol version: " + buffer.substring(indexFrom, indexTo)); ok = (buffer.charAt(i+j) == protoname.charAt(j)); ok = (buffer.charAt(i+protolength) == '/'); throw new ParseException ("Not a valid protocol version: " + buffer.substring(indexFrom, indexTo)); cursor.updatePos(blank); return createProtocolVersion(major, minor);
int indexFrom = cursor.getPos(); int indexTo = cursor.getUpperBound(); ProtocolVersion ver = parseProtocolVersion(buffer, cursor); skipWhitespace(buffer, cursor); int i = cursor.getPos(); int blank = buffer.indexOf(' ', i, indexTo); if (blank < 0) { blank = indexTo; try { statusCode = Integer.parseInt(buffer.substringTrimmed(i, blank)); } catch (NumberFormatException e) { throw new ParseException( "Unable to parse status code from status line: " + buffer.substring(indexFrom, indexTo)); reasonPhrase = ""; return createStatusLine(ver, statusCode, reasonPhrase); throw new ParseException("Invalid status line: " + buffer.substring(indexFrom, indexTo));
@Override public ProtocolVersion parseProtocolVersion(CharArrayBuffer buffer, ParserCursor cursor) { int index = cursor.getPos(); int bound = cursor.getUpperBound(); if (bound >= index + 4 && "ICY ".equals(buffer.substring(index, index + 4))) { cursor.updatePos(index + 4); return ICY_PROTOCOL; } return super.parseProtocolVersion(buffer, cursor); }
private StatusLine parseStatusLine(String line) { if (TextUtils.isEmpty(line)) { return null; } return BasicLineParser.parseStatusLine(line, new BasicLineParser()); }
private Header parseHeader(String line) { return BasicLineParser.parseHeader(line, new BasicLineParser()); }
/** * Retrieves the status code portion of the Response's <CODE>status</CODE> element. * If it is not present, returns {@link #DEFAULT_STATUS_CODE} (a.k.a. <CODE>200</CODE>). * * @param response The response complex type of the multistatus * @return DEFAULT_STATUS_CODE if not found in response; -1 if status line was malformed */ private int getStatusCode(Response response) { String status = response.getStatus(); if (status == null || status.isEmpty()) { return DEFAULT_STATUS_CODE; } try { return BasicLineParser.parseStatusLine(response.getStatus(), null).getStatusCode(); } catch (ParseException e) { log.warning(String.format("Failed to parse status line: %s", status)); return -1; } }
new DefaultHttpResponseParser( new ByteArraySessionInputBuffer(this._payload, 0, end), new BasicLineParser(), new DefaultHttpResponseFactory(), new BasicHttpParams()
private StatusLine parseStatusLine(String line) { if (TextUtils.isEmpty(line)) { return null; } return BasicLineParser.parseStatusLine(line, new BasicLineParser()); }
private Header parseHeader(String line) { return BasicLineParser.parseHeader(line, new BasicLineParser()); }
private static void fromXml(Element response, List<MultiStatus> result) throws IOException { Element href; String str; ChildElements iter; Element propstat; String propstatStatus; Element prop; int status; ChildElements propIter; Dom.require(response, Method.XML_RESPONSE, Method.DAV); href = Dom.getFirstChildElement(response, "href", Method.DAV); if (href == null) { throw new IOException("missing href"); } str = Dom.getString(href).trim(); iter = Method.DAV.childElements(response, XML_PROPSTAT); while (iter.hasNext()) { propstat = iter.next(); propstatStatus = Dom.getString(Dom.getFirstChildElement(propstat, XML_STATUS, Method.DAV)); prop = Dom.getFirstChildElement(propstat, Method.XML_PROP, Method.DAV); status = BasicLineParser.parseStatusLine(propstatStatus, BasicLineParser.DEFAULT).getStatusCode(); propIter = new ChildElements(prop); while (propIter.hasNext()) { result.add(new MultiStatus(str, Property.fromXml(propIter.next()), status)); } } }
int indexFrom = cursor.getPos(); int indexTo = cursor.getUpperBound(); skipWhitespace(buffer, cursor); int i = cursor.getPos(); String method = buffer.substringTrimmed(i, blank); cursor.updatePos(blank); skipWhitespace(buffer, cursor); i = cursor.getPos(); cursor.updatePos(blank); ProtocolVersion ver = parseProtocolVersion(buffer, cursor); skipWhitespace(buffer, cursor); if (!cursor.atEnd()) { throw new ParseException("Invalid request line: " + buffer.substring(indexFrom, indexTo)); return createRequestLine(method, uri, ver); } catch (IndexOutOfBoundsException e) { throw new ParseException("Invalid request line: " +
final int protolength = protoname.length(); int indexFrom = cursor.getPos(); int indexTo = cursor.getUpperBound(); skipWhitespace(buffer, cursor); int i = cursor.getPos(); throw new ParseException ("Not a valid protocol version: " + buffer.substring(indexFrom, indexTo)); ok = (buffer.charAt(i+j) == protoname.charAt(j)); ok = (buffer.charAt(i+protolength) == '/'); throw new ParseException ("Not a valid protocol version: " + buffer.substring(indexFrom, indexTo)); cursor.updatePos(blank); return createProtocolVersion(major, minor);
int indexFrom = cursor.getPos(); int indexTo = cursor.getUpperBound(); ProtocolVersion ver = parseProtocolVersion(buffer, cursor); skipWhitespace(buffer, cursor); int i = cursor.getPos(); int blank = buffer.indexOf(' ', i, indexTo); if (blank < 0) { blank = indexTo; try { statusCode = Integer.parseInt(buffer.substringTrimmed(i, blank)); } catch (NumberFormatException e) { throw new ParseException( "Unable to parse status code from status line: " + buffer.substring(indexFrom, indexTo)); reasonPhrase = ""; return createStatusLine(ver, statusCode, reasonPhrase); throw new ParseException("Invalid status line: " + buffer.substring(indexFrom, indexTo));
int indexFrom = cursor.getPos(); int indexTo = cursor.getUpperBound(); skipWhitespace(buffer, cursor); int i = cursor.getPos(); String method = buffer.substringTrimmed(i, blank); cursor.updatePos(blank); skipWhitespace(buffer, cursor); i = cursor.getPos(); cursor.updatePos(blank); ProtocolVersion ver = parseProtocolVersion(buffer, cursor); skipWhitespace(buffer, cursor); if (!cursor.atEnd()) { throw new ParseException("Invalid request line: " + buffer.substring(indexFrom, indexTo)); return createRequestLine(method, uri, ver); } catch (IndexOutOfBoundsException e) { throw new ParseException("Invalid request line: " +
final int protolength = protoname.length(); int indexFrom = cursor.getPos(); int indexTo = cursor.getUpperBound(); skipWhitespace(buffer, cursor); int i = cursor.getPos(); throw new ParseException ("Not a valid protocol version: " + buffer.substring(indexFrom, indexTo)); ok = (buffer.charAt(i+j) == protoname.charAt(j)); ok = (buffer.charAt(i+protolength) == '/'); throw new ParseException ("Not a valid protocol version: " + buffer.substring(indexFrom, indexTo)); cursor.updatePos(blank); return createProtocolVersion(major, minor);
int indexFrom = cursor.getPos(); int indexTo = cursor.getUpperBound(); ProtocolVersion ver = parseProtocolVersion(buffer, cursor); skipWhitespace(buffer, cursor); int i = cursor.getPos(); int blank = buffer.indexOf(' ', i, indexTo); if (blank < 0) { blank = indexTo; try { statusCode = Integer.parseInt(buffer.substringTrimmed(i, blank)); } catch (NumberFormatException e) { throw new ParseException( "Unable to parse status code from status line: " + buffer.substring(indexFrom, indexTo)); reasonPhrase = ""; return createStatusLine(ver, statusCode, reasonPhrase); throw new ParseException("Invalid status line: " + buffer.substring(indexFrom, indexTo));
int indexFrom = cursor.getPos(); int indexTo = cursor.getUpperBound(); skipWhitespace(buffer, cursor); int i = cursor.getPos(); String method = buffer.substringTrimmed(i, blank); cursor.updatePos(blank); skipWhitespace(buffer, cursor); i = cursor.getPos(); cursor.updatePos(blank); ProtocolVersion ver = parseProtocolVersion(buffer, cursor); skipWhitespace(buffer, cursor); if (!cursor.atEnd()) { throw new ParseException("Invalid request line: " + buffer.substring(indexFrom, indexTo)); return createRequestLine(method, uri, ver); } catch (IndexOutOfBoundsException e) { throw new ParseException("Invalid request line: " +
final int protolength = protoname.length(); int indexFrom = cursor.getPos(); int indexTo = cursor.getUpperBound(); skipWhitespace(buffer, cursor); int i = cursor.getPos(); throw new ParseException ("Not a valid protocol version: " + buffer.substring(indexFrom, indexTo)); ok = (buffer.charAt(i+j) == protoname.charAt(j)); ok = (buffer.charAt(i+protolength) == '/'); throw new ParseException ("Not a valid protocol version: " + buffer.substring(indexFrom, indexTo)); cursor.updatePos(blank); return createProtocolVersion(major, minor);
int indexFrom = cursor.getPos(); int indexTo = cursor.getUpperBound(); ProtocolVersion ver = parseProtocolVersion(buffer, cursor); skipWhitespace(buffer, cursor); int i = cursor.getPos(); int blank = buffer.indexOf(' ', i, indexTo); if (blank < 0) { blank = indexTo; try { statusCode = Integer.parseInt(buffer.substringTrimmed(i, blank)); } catch (NumberFormatException e) { throw new ParseException( "Unable to parse status code from status line: " + buffer.substring(indexFrom, indexTo)); reasonPhrase = ""; return createStatusLine(ver, statusCode, reasonPhrase); throw new ParseException("Invalid status line: " + buffer.substring(indexFrom, indexTo));