Get the context-root from the ByteBuffer
// (1) Get the token the Algorithm has processed for us.
ByteBuffer byteBuffer = readTask.getByteBuffer();
byte[] chars = new byte[byteBuffer.limit() - byteBuffer.position()];
byteBuffer.get(chars);
String token = new String(chars);
// Remove query string.
int index = token.indexOf(QUERY_STRING);
if ( index != -1){
token = token.substring(0,index);
}
boolean slash = token.endsWith(PATH_STRING);
if ( slash ){
token = token.substring(0,token.length() -1);
}
return token;