MCPcopy Index your code
hub / github.com/OpenTSDB/opentsdb / getCharset

Method getCharset

src/tsd/AbstractHttpQuery.java:324–334  ·  view source on GitHub ↗

Attempts to parse the character set from the request header. If not set defaults to UTF-8 @return A Charset object @throws UnsupportedCharsetException if the parsed character set is invalid

()

Source from the content-addressed store, hash-verified

322 * @throws UnsupportedCharsetException if the parsed character set is invalid
323 */
324 public Charset getCharset() {
325 // RFC2616 3.7
326 for (String type : this.request.headers().getAll("Content-Type")) {
327 int idx = type.toUpperCase().indexOf("CHARSET=");
328 if (idx > 1) {
329 String charset = type.substring(idx+8);
330 return Charset.forName(charset);
331 }
332 }
333 return Charset.forName("UTF-8");
334 }
335
336 /** @return True if the request has content, false if not. */
337 public boolean hasContent() {

Callers 10

getContentMethod · 0.95
answerMethod · 0.80
getCharsetDefaultMethod · 0.80
getCharsetSuppliedMethod · 0.80
getCharsetInvalidMethod · 0.80
formatQueryAsyncV1Method · 0.80
formatNotFoundV1Method · 0.80
formatErrorV1Method · 0.80
redirectMethod · 0.80

Calls

no outgoing calls

Tested by 5

answerMethod · 0.64
getCharsetDefaultMethod · 0.64
getCharsetSuppliedMethod · 0.64
getCharsetInvalidMethod · 0.64