ch.qos.logback.core.Layout.getContentType()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(3.9k)|赞(0)|评价(0)|浏览(63)

本文整理了Java中ch.qos.logback.core.Layout.getContentType()方法的一些代码示例,展示了Layout.getContentType()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Layout.getContentType()方法的具体详情如下:
包路径:ch.qos.logback.core.Layout
类名称:Layout
方法名:getContentType

Layout.getContentType介绍

[英]Returns the content type as appropriate for the implementation.
[中]返回适合于实现的内容类型。

代码示例

代码示例来源:origin: camunda/camunda-bpm-platform

mimeMsg.setRecipients(Message.RecipientType.TO, toAddressArray);
String contentType = layout.getContentType();
     .getSubType(contentType));
} else {
 part.setContent(sbuf.toString(), layout.getContentType());

代码示例来源:origin: qos-ch/logback-extensions

/**
 * Creates a configured HTTP connection to a URL (does not open the
 * connection)
 *
 * @param url target URL
 * @return the newly created HTTP connection
 * @throws IOException connection error
 */
protected HttpURLConnection getHttpConnection(URL url) throws IOException {
  HttpURLConnection conn;
  if (proxy == null) {
    conn = (HttpURLConnection) url.openConnection();
  } else {
    conn = (HttpURLConnection) url.openConnection(proxy);
  }
  conn.setDoOutput(true);
  conn.setDoInput(true);
  conn.setRequestProperty("Content-Type", layout.getContentType() + "; charset=" + charset.name());
  conn.setRequestMethod("POST");
  conn.setReadTimeout(getHttpReadTimeoutInMillis());
  return conn;
}

代码示例来源:origin: qos-ch/logback-extensions

private void postToLoggly(final String event) {
  try {
    assert endpointUrl != null;
    URL endpoint = new URL(endpointUrl);
    final HttpURLConnection connection;
    if (proxy == null) {
      connection = (HttpURLConnection) endpoint.openConnection();
    } else {
      connection = (HttpURLConnection) endpoint.openConnection(proxy);
    }
    connection.setRequestMethod("POST");
    connection.setDoOutput(true);
    connection.addRequestProperty("Content-Type", this.layout.getContentType());
    connection.connect();
    sendAndClose(event, connection.getOutputStream());
    connection.disconnect();
    final int responseCode = connection.getResponseCode();
    if (responseCode != 200) {
      final String message = readResponseBody(connection.getInputStream());
      addError("Loggly post failed (HTTP " + responseCode + ").  Response body:\n" + message);
    }
  } catch (final IOException e) {
    addError("IOException while attempting to communicate with Loggly", e);
  }
}

代码示例来源:origin: com.alibaba.citrus.tool/antx-autoexpand

String contentType = layout.getContentType();
   .getSubType(contentType));
} else {
 part.setContent(sbuf.toString(), layout.getContentType());

代码示例来源:origin: tony19/logback-android

mimeMsg.setRecipients(Message.RecipientType.TO, toAddressArray);
String contentType = layout.getContentType();
     .getSubType(contentType));
} else {
 part.setContent(sbuf.toString(), layout.getContentType());

代码示例来源:origin: ch.qos.logback/core

mimeMsg.setRecipients(Message.RecipientType.TO, toAddressArray);
String contentType = layout.getContentType();
     .getSubType(contentType));
} else {
 part.setContent(sbuf.toString(), layout.getContentType());

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/ch.qos.logback.core

mimeMsg.setRecipients(Message.RecipientType.TO, toAddressArray);
String contentType = layout.getContentType();
     .getSubType(contentType));
} else {
 part.setContent(sbuf.toString(), layout.getContentType());

代码示例来源:origin: com.hynnet/logback-core

mimeMsg.setRecipients(Message.RecipientType.TO, toAddressArray);
String contentType = layout.getContentType();
     .getSubType(contentType));
} else {
 part.setContent(sbuf.toString(), layout.getContentType());

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

mimeMsg.setRecipients(Message.RecipientType.TO, toAddressArray);
String contentType = layout.getContentType();
  part.setContent(sbuf.toString(), layout.getContentType());

代码示例来源:origin: io.virtdata/virtdata-lib-realer

mimeMsg.setRecipients(Message.RecipientType.TO, toAddressArray);
String contentType = layout.getContentType();
  part.setContent(sbuf.toString(), layout.getContentType());

代码示例来源:origin: Nextdoor/bender

mimeMsg.setRecipients(Message.RecipientType.TO, toAddressArray);
String contentType = layout.getContentType();
  part.setContent(sbuf.toString(), layout.getContentType());

相关文章