int protocolVersion;
try {
protocolVersion = Integer.parseInt(parts.next());
} catch (NumberFormatException e) {
resp.sendError(400, e.getLocalizedMessage());
return;
}
if (protocolVersion != PROTOCOL_VERSION) {
resp.sendError(501, String.format("Protocol version not implemented (supports v%d)", PROTOCOL_VERSION));