Codota Logo
XMLFormatterWriter.<init>
Code IndexAdd Codota to your IDE (free)

How to use
de.unkrig.commons.io.XMLFormatterWriter
constructor

Best Java code snippets using de.unkrig.commons.io.XMLFormatterWriter.<init> (Showing top 6 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Point p =
  • Codota Iconnew Point(x, y)
  • Codota Iconnew Point()
  • Codota IconMouseEvent e;e.getPoint()
  • Smart code suggestions by Codota
}
origin: de.unkrig.commons/commons-net

  @Override public void
  run() throws IOException {
    InputStream in = new ByteArrayInputStream(buffer.toByteArray());
    // Process "Content-Encoding" header.
    if ("gzip".equalsIgnoreCase(HttpMessage.this.getHeader("Content-Encoding"))) {
      LOGGER.fine(loggingPrefix + "GZIP-encoded content");
      in = new GZIPInputStream(in);
    }
    if (LOGGER.isLoggable(FINE)) {
      LOGGER.fine(loggingPrefix + "Reading message body");
      Writer lw = LogUtil.logWriter(LOGGER, FINE, loggingPrefix);
      in = InputStreams.wye(in, (
        HttpMessage.this.contentTypeIsXmlish()
        ? new WriterOutputStream(new XMLFormatterWriter(lw))
        : new HexOutputStream(lw)
      ));
    }
    HttpMessage.this.setBody(HttpMessage.body(in));
    finished.run();
  }
};
origin: de.unkrig.commons/commons-net

/**
 * Writes the body of this message <em>synchronously</em> to the given {@link OutputStream}.
 *
 * @param loggingPrefix E.g. {@code "<<< "}
 */
private void
writeBody(String loggingPrefix, OutputStream out) throws IOException {
  // Check "Content-Encoding: gzip"
  GZIPOutputStream finishable = null;
  if ("gzip".equalsIgnoreCase(this.getHeader("Content-Encoding"))) {
    LOGGER.fine(loggingPrefix + "GZIP-encoded contents");
    out = (finishable = new GZIPOutputStream(out));
  }
  if (LOGGER.isLoggable(FINE)) {
    LOGGER.fine(loggingPrefix + "Writing message body:");
    Writer lw = LogUtil.logWriter(LOGGER, FINE, loggingPrefix);
    out = OutputStreams.tee(out, (
      this.contentTypeIsXmlish()
      ? new WriterOutputStream(new XMLFormatterWriter(lw))
      : new HexOutputStream(lw)
    ));
  }
  this.body.write(out);
  if (finishable != null) finishable.finish();
  out.flush();
}
origin: de.unkrig/de-unkrig-commons

/**
 * Writes the body of this message <em>synchronously</em> to the given {@link OutputStream}.
 */
private void
writeBody(String prefix, OutputStream out) throws IOException {
  // Check "Content-Encoding: gzip"
  GZIPOutputStream finishable = null;
  if ("gzip".equalsIgnoreCase(this.getHeader("Content-Encoding"))) {
    LOGGER.fine(prefix + "GZIP-encoded contents");
    out = (finishable = new GZIPOutputStream(out));
  }
  final boolean isXml;
  {
    String ct = this.getHeader("Content-Type");
    isXml = ct != null && ct.indexOf("text/xml") != -1;
  }
  if (LOGGER.isLoggable(FINE)) {
    LOGGER.fine(prefix + "Writing message body:");
    Writer lw = LogUtil.logWriter(LOGGER, FINE, prefix);
    out = IoUtil.tee(out, (
      isXml
      ? new WriterOutputStream(new XMLFormatterWriter(lw))
      : new HexOutputStream(lw)
    ));
  }
  this.body.write(out);
  if (finishable != null) finishable.finish();
  out.flush();
}
origin: de.unkrig/de-unkrig-commons

  @Override public void
  run() throws IOException {
    InputStream in = new ByteArrayInputStream(buffer.toByteArray());
    // Process "Content-Encoding" header.
    if ("gzip".equalsIgnoreCase(HttpMessage.this.getHeader("Content-Encoding"))) {
      LOGGER.fine("GZIP-encoded content");
      in = new GZIPInputStream(in);
    }
    if (LOGGER.isLoggable(FINE)) {
      boolean isXml = false;
      LOGGER.fine("Reading message body");
      String contentType = HttpMessage.this.getHeader("Content-Type");
      if (contentType != null) {
        ParametrizedHeaderValue phv = new ParametrizedHeaderValue(contentType);
        if ("text/xml".equalsIgnoreCase(phv.getToken())) isXml = true;
      }
      Writer logWriter = LogUtil.logWriter(LOGGER, FINE, ">>> ");
      in = IoUtil.wye(in, (
        isXml
        ? new WriterOutputStream(new XMLFormatterWriter(logWriter))
        : new HexOutputStream(logWriter)
      ));
    }
    HttpMessage.this.setBody(HttpMessage.body(in));
    finished.run();
  }
};
origin: de.unkrig/de-unkrig-commons

in = IoUtil.wye(in, (
  isXml
  ? new WriterOutputStream(new XMLFormatterWriter(logWriter))
  : new HexOutputStream(logWriter)
));
origin: de.unkrig.commons/commons-net

in = InputStreams.wye(in, (
  this.contentTypeIsXmlish()
  ? new WriterOutputStream(new XMLFormatterWriter(lw))
  : new HexOutputStream(lw)
));
de.unkrig.commons.ioXMLFormatterWriter<init>

Popular methods of XMLFormatterWriter

  • write

Popular in Java

  • Creating JSON documents from java classes using gson
  • getResourceAsStream (ClassLoader)
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • onRequestPermissionsResult (Fragment)
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • Collectors (java.util.stream)
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • BoxLayout (javax.swing)
  • JTable (javax.swing)
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now