equal
deleted
inserted
replaced
84 * <pre> {@code // A LineParserSubscriber that implements Flow.Subscriber<String> |
84 * <pre> {@code // A LineParserSubscriber that implements Flow.Subscriber<String> |
85 * // and accumulates lines that match a particular pattern |
85 * // and accumulates lines that match a particular pattern |
86 * Pattern pattern = ...; |
86 * Pattern pattern = ...; |
87 * LineParserSubscriber subscriber = new LineParserSubscriber(pattern); |
87 * LineParserSubscriber subscriber = new LineParserSubscriber(pattern); |
88 * HttpResponse<List<String>> response = client.send(request, |
88 * HttpResponse<List<String>> response = client.send(request, |
89 * BodyHandler.fromLineSubscriber(subscriber, s -> s.getMatchingLines(), "\n")); |
89 * BodyHandler.fromLineSubscriber(subscriber, s -> s.getMatchingLines(), "\n")); |
90 * if (response.statusCode() != 200) { |
90 * if (response.statusCode() != 200) { |
91 * System.err.printf("ERROR: %d status received%n", response.statusCode()); |
91 * System.err.printf("ERROR: %d status received%n", response.statusCode()); |
92 * } }</pre> |
92 * } }</pre> |
93 * |
93 * |
94 */ |
94 */ |