MCPcopy Index your code
hub / github.com/zaproxy/zaproxy / setCustomErrStream

Method setCustomErrStream

zap/src/main/java/org/zaproxy/zap/ZAP.java:111–143  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

109 }
110
111 private static void setCustomErrStream() {
112 System.setErr(
113 new DelegatorPrintStream(System.err) {
114
115 private static final byte[] XML_PROLOG_ERROR =
116 "[Fatal Error] :1:1: Content is not allowed in prolog."
117 .getBytes(StandardCharsets.US_ASCII);
118 private static final int XML_PROLOG_ERROR_LEN = XML_PROLOG_ERROR.length;
119
120 @Override
121 public void write(byte[] buf, int off, int len) {
122 if (len >= XML_PROLOG_ERROR_LEN
123 && Arrays.equals(
124 buf,
125 off,
126 XML_PROLOG_ERROR_LEN,
127 XML_PROLOG_ERROR,
128 0,
129 XML_PROLOG_ERROR_LEN)) {
130 return;
131 }
132 super.write(buf, off, len);
133 }
134
135 @Override
136 public void println(String x) {
137 if (x != null && x.startsWith("Multiplexing LAF")) {
138 return;
139 }
140 super.println(x);
141 }
142 });
143 }
144
145 private static ZapBootstrap createZapBootstrap(CommandLine cmdLineArgs) {
146 ZapBootstrap bootstrap;

Callers 1

mainMethod · 0.95

Calls 1

getBytesMethod · 0.45

Tested by

no test coverage detected