Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Constructor with a raw status line.
- *
- * @param line
- * A status line.
- *
- * @throws NullPointerException
- * {@code line} is {@code null}
- *
- * @throws IllegalArgumentException
- * The number of elements in {@code line} is less than 2.
- *
- * @throws NumberFormatException
- * Failed to parse the second element in {@code line}
- * as an integer.
- */
- StatusLine(String line)
- {
- // HTTP-Version Status-Code Reason-Phrase
- String[] elements = line.split(" +", 3);
- if (elements.length < 2)
- {
- throw new IllegalArgumentException();
- }
- mHttpVersion = elements[0];
- mStatusCode = Integer.parseInt(elements[1]);
- mReasonPhrase = (elements.length == 3) ? elements[2] : null;
- mString = line;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement