private BufferedInputStream handleEncoding(final BufferedInputStream is) throws IOException { Header<?> encodingHeader = Header.find(headers, "Content-Encoding"); if (encodingHeader != null) { if (encodingHeader.getValue().equals("gzip")) { return new BufferedInputStream(new GZIPInputStream(is)); } else if (encodingHeader.getValue().equals("deflate")) { return new BufferedInputStream(new InflaterInputStream(is)); } } return is; }
private BufferedInputStream handleEncoding(final BufferedInputStream is) throws IOException { Header<?> encodingHeader = Header.find(headers, "Content-Encoding"); if (encodingHeader != null) { if (encodingHeader.getValue().equals("gzip")) { return new BufferedInputStream(new GZIPInputStream(is)); } else if (encodingHeader.getValue().equals("deflate")) { return new BufferedInputStream(new InflaterInputStream(is)); } } return is; }
private InputStream handleEncoding(final InputStream is) throws IOException { Header<?> encodingHeader = Header.find(headers, "Content-Encoding"); if (encodingHeader != null) { if (encodingHeader.getValue().equals("gzip")) { return new GZIPInputStream(is); } else if (encodingHeader.getValue().equals("deflate")) { return new InflaterInputStream(is); } } return is; }
/** * Retrieves the value of the charset from the "Content-Type" response header. * * @return the value of the charset from the "Content-Type" response header */ default Charset getCharset() { final Header.CombinedMap header = (Header.CombinedMap) Header.find(getHeaders(), "Content-Type"); if (header == null) { return StandardCharsets.UTF_8; } if (header.getParsed().containsKey("charset")) { Charset.forName(header.getParsed().get("charset")); } return StandardCharsets.UTF_8; }
/** * Retrieves the value of the charset from the "Content-Type" response header. * * @return the value of the charset from the "Content-Type" response header */ default Charset getCharset() { final Header.CombinedMap header = (Header.CombinedMap) Header.find(getHeaders(), "Content-Type"); if (header == null) { return StandardCharsets.UTF_8; } if (header.getParsed().containsKey("charset")) { Charset.forName(header.getParsed().get("charset")); } return StandardCharsets.UTF_8; }
/** * Retrieves the value of the charset from the "Content-Type" response header. * * @return the value of the charset from the "Content-Type" response header */ default Charset getCharset() { final Header.CombinedMap header = (Header.CombinedMap) Header.find(getHeaders(), "Content-Type"); if (header == null) { return StandardCharsets.UTF_8; } if (header.getParsed().containsKey("charset")) { Charset.forName(header.getParsed().get("charset")); } return StandardCharsets.UTF_8; }
/** * Retrieves the value of the "Content-Type" header from the response. * * @return the value of the "Content-Type" response header */ default String getContentType() { final Header.CombinedMap header = (Header.CombinedMap) Header.find(getHeaders(), "Content-Type"); if (header == null) { return DEFAULT_CONTENT_TYPE; } else { return header.getParsed().get("Content-Type"); } }
/** * Retrieves the value of the "Content-Type" header from the response. * * @return the value of the "Content-Type" response header */ default String getContentType() { final Header.CombinedMap header = (Header.CombinedMap) Header.find(getHeaders(), "Content-Type"); if (header == null) { return DEFAULT_CONTENT_TYPE; } else { return header.getParsed().get("Content-Type"); } }
/** * Retrieves the value of the "Content-Type" header from the response. * * @return the value of the "Content-Type" response header */ default String getContentType() { final Header.CombinedMap header = (Header.CombinedMap) Header.find(getHeaders(), "Content-Type"); if (header == null) { return DEFAULT_CONTENT_TYPE; } else { return header.getParsed().get("Content-Type"); } }