private void endWithMessage(ServerHttpExchange http, String data) {
      endedWithMessage.set(true);
      boolean jsonp = "true".equals(params.get("cettia-transport-jsonp"));
      if (jsonp) {
        try {
          data = params.get("cettia-transport-callback") + "(" + mapper.writeValueAsString(data) + ");";
        } catch (JsonProcessingException e) {
          throw new RuntimeException(e);
        }
      }
      http.setHeader("content-type", (jsonp ? "text/javascript" : "text/plain") + "; charset=utf-8").end(data);
    }
private void endWithMessage ( ServerHttpExchange http , String data ) { endedWithMessage . set ( true ) ; boolean jsonp = "true" . equals ( params . get ( "cettia-transport-jsonp" ) ) ; if ( jsonp ) { try { data = params . get ( "cettia-transport-callback" ) + "(" + mapper . writeValueAsString ( data ) + ");" ; } catch ( JsonProcessingException e ) { throw new RuntimeException ( e ) ; } } http . setHeader ( "content-type" , ( jsonp ? "text/javascript" : "text/plain" ) + "; charset=utf-8" ) . end ( data ) ; }
Regard it as http.endWithMessage