@Override protected void parseChallenge( final CharArrayBuffer buffer, int pos, int len) throws MalformedChallengeException { String challenge = buffer.substringTrimmed(pos, len); if (challenge.length() == 0) { if (this.state == State.UNINITIATED) { this.state = State.CHALLENGE_RECEIVED; } else { this.state = State.FAILED; } this.challenge = null; } else { this.state = State.MSG_TYPE2_RECEVIED; this.challenge = challenge; } }
public String getValue() { return this.buffer.substringTrimmed(this.valuePos, this.buffer.length()); }
/** * Creates a new header from a buffer. * The name of the header will be parsed immediately, * the value only if it is accessed. * * @param buffer the buffer containing the header to represent * * @throws ParseException in case of a parse error */ public BufferedHeader(final CharArrayBuffer buffer) throws ParseException { super(); if (buffer == null) { throw new IllegalArgumentException ("Char array buffer may not be null"); } int colon = buffer.indexOf(':'); if (colon == -1) { throw new ParseException ("Invalid header: " + buffer.toString()); } String s = buffer.substringTrimmed(0, colon); if (s.length() == 0) { throw new ParseException ("Invalid header: " + buffer.toString()); } this.buffer = buffer; this.name = s; this.valuePos = colon + 1; }
try { statusCode = Integer.parseInt(buffer.substringTrimmed(i, blank)); } catch (NumberFormatException e) { throw new ParseException( String reasonPhrase = null; if (i < indexTo) { reasonPhrase = buffer.substringTrimmed(i, indexTo); } else { reasonPhrase = "";
major = Integer.parseInt(buffer.substringTrimmed(i, period)); } catch (NumberFormatException e) { throw new ParseException minor = Integer.parseInt(buffer.substringTrimmed(i, blank)); } catch (NumberFormatException e) { throw new ParseException(
return Integer.parseInt(this.buffer.substringTrimmed(0, separator), 16); } catch (NumberFormatException e) { throw new MalformedChunkCodingException("Bad chunk header");
separator = this.buffer.length(); final String s = this.buffer.substringTrimmed(0, separator); try { return Long.parseLong(s, 16);
name = buffer.substringTrimmed(indexFrom, indexTo); } else { name = buffer.substringTrimmed(indexFrom, pos); pos++;
buffer.substring(indexFrom, indexTo)); String method = buffer.substringTrimmed(i, blank); cursor.updatePos(blank); buffer.substring(indexFrom, indexTo)); String uri = buffer.substringTrimmed(i, blank); cursor.updatePos(blank);
@Override protected void parseChallenge( final CharArrayBuffer buffer, int pos, int len) throws MalformedChallengeException { String challenge = buffer.substringTrimmed(pos, len); if (challenge.length() == 0) { if (this.state == State.UNINITIATED) { this.state = State.CHALLENGE_RECEIVED; } else { this.state = State.FAILED; } this.challenge = null; } else { this.state = State.MSG_TYPE2_RECEVIED; this.challenge = challenge; } }
public String getValue() { return this.buffer.substringTrimmed(this.valuePos, this.buffer.length()); }
@Override public String getValue() { return this.buffer.substringTrimmed(this.valuePos, this.buffer.length()); }
@Override public String getValue() { return this.buffer.substringTrimmed(this.valuePos, this.buffer.length()); }
@Override public String getValue() { return this.buffer.substringTrimmed(this.valuePos, this.buffer.length()); }
public String getValue() { return this.buffer.substringTrimmed(this.valuePos, this.buffer.length()); }
@Override public String getValue() { return this.buffer.substringTrimmed(this.valuePos, this.buffer.length()); }
public String getValue() { return this.buffer.substringTrimmed(this.valuePos, this.buffer.length()); }
public String getValue() { return this.buffer.substringTrimmed(this.valuePos, this.buffer.length()); }
@Override protected void parseChallenge( final CharArrayBuffer buffer, final int beginIndex, final int endIndex) { this.challenge = buffer.substringTrimmed(beginIndex, endIndex); if(this.challenge.isEmpty()) { if(clientCred != null) { dispose(); // run cleanup first before throwing an exception otherwise can leak OS resources if(continueNeeded) { throw new RuntimeException("Unexpected token"); } } } }
public String getValue() { return this.buffer.substringTrimmed(this.valuePos, this.buffer.length()); }