String[] parts = WHITESPACE_PATTERN.split(query);
for (int i = 0; i < parts.length; i++) {
String token = parts[i];
int colonIndex = token.indexOf(":");
if (colonIndex == -1) {
throw new BadQueryException("Bad search token(" + token + ")");
}
try {
String key = URLDecoder.decode(token.substring(0, colonIndex),
"UTF-8");
String value = URLDecoder.decode(
token.substring(colonIndex + 1), "UTF-8");
// TODO: make sure key is in singleTokens?
// let's just let em all thru for now:
wbRequest.put(key, value);
} catch (UnsupportedEncodingException e) {
throw new BadQueryException("Unsupported encoding: UTF-8");
}
}
if (wbRequest.getStartTimestamp() == null) {
wbRequest.setStartTimestamp(getEarliestTimestamp());
}