in src/main/java/com/microsoft/azure/proton/transport/proxy/HttpStatusLine.java [42:64]
public static HttpStatusLine create(String line) {
final String[] components = line.split(" ", 3);
if (components.length != 3) {
throw new IllegalArgumentException(String.format(Locale.ROOT,
"HTTP status-line is invalid. Line: %s", line));
}
final String[] protocol = components[0].split("/", 2);
if (protocol.length != 2) {
throw new IllegalArgumentException(String.format(Locale.ROOT,
"Protocol is invalid, expected HTTP/{version}. Actual: %s", components[0]));
}
int statusCode;
try {
statusCode = Integer.parseInt(components[1]);
} catch (NumberFormatException e) {
throw new IllegalArgumentException(String.format(Locale.US,
"HTTP Status code '%s' is not valid.", components[1]), e);
}
return new HttpStatusLine(protocol[1], statusCode, components[2]);
}