private void initStreams() throws IOException { traceInput = new TraceInputStream(socket.getInputStream(), traceLogger); traceInput.setQuote(quote); input = new ResponseInputStream(traceInput); traceOutput = new TraceOutputStream(socket.getOutputStream(), traceLogger); traceOutput.setQuote(quote); output = new DataOutputStream(new BufferedOutputStream(traceOutput)); }
/** * Resume protocol tracing, if it was enabled to begin with. */ protected void resumeTracing() { if (traceLogger.isLoggable(Level.FINEST)) { traceInput.setTrace(true); traceOutput.setTrace(true); } }
/** * Writes the specified <code>byte</code> to this output stream. * Writes out the byte into the trace stream if the trace mode * is <code>true</code> * * @param b the byte to write * @exception IOException for I/O errors */ public void write(int b) throws IOException { if (trace) { if (quote) writeByte(b); else traceOut.write(b); } out.write(b); }
private void initStreams(PrintStream out) throws IOException { traceInput = new TraceInputStream(socket.getInputStream(), out); traceInput.setTrace(debug); traceInput.setQuote(quote); input = new ResponseInputStream(traceInput); traceOutput = new TraceOutputStream(socket.getOutputStream(), out); traceOutput.setTrace(debug); traceOutput.setQuote(quote); output = new DataOutputStream(new BufferedOutputStream(traceOutput)); }
private void initStreams(PrintStream out) throws IOException { traceInput = new TraceInputStream(socket.getInputStream(), out); traceInput.setTrace(debug); traceInput.setQuote(quote); input = new ResponseInputStream(traceInput); traceOutput = new TraceOutputStream(socket.getOutputStream(), out); traceOutput.setTrace(debug); traceOutput.setQuote(quote); output = new DataOutputStream(new BufferedOutputStream(traceOutput)); }
private void initStreams() throws IOException { traceInput = new TraceInputStream(socket.getInputStream(), traceLogger); traceInput.setQuote(quote); input = new ResponseInputStream(traceInput); traceOutput = new TraceOutputStream(socket.getOutputStream(), traceLogger); traceOutput.setQuote(quote); output = new DataOutputStream(new BufferedOutputStream(traceOutput)); }
/** * Constructor for debugging. */ public Protocol(InputStream in, OutputStream out, boolean debug) throws IOException { this.host = "localhost"; this.debug = debug; this.quote = false; this.out = System.out; // XXX - inlined initStreams, won't allow later startTLS traceInput = new TraceInputStream(in, System.out); traceInput.setTrace(debug); traceInput.setQuote(quote); input = new ResponseInputStream(traceInput); traceOutput = new TraceOutputStream(out, System.out); traceOutput.setTrace(debug); traceOutput.setQuote(quote); output = new DataOutputStream(new BufferedOutputStream(traceOutput)); timestamp = System.currentTimeMillis(); }
/** * Resume protocol tracing, if it was enabled to begin with. */ private void resumeTracing() { if (traceLogger.isLoggable(Level.FINEST)) { traceInput.setTrace(true); traceOutput.setTrace(true); } }
/** * Writes the specified <code>byte</code> to this output stream. * Writes out the byte into the trace stream if the trace mode * is <code>true</code> * * @param b the byte to write * @exception IOException for I/O errors */ @Override public void write(int b) throws IOException { if (trace) { if (quote) writeByte(b); else traceOut.write(b); } out.write(b); }
private void initStreams() throws IOException { boolean quote = PropUtil.getBooleanProperty(props, "mail.debug.quote", false); traceInput = new TraceInputStream(socket.getInputStream(), traceLogger); traceInput.setQuote(quote); traceOutput = new TraceOutputStream(socket.getOutputStream(), traceLogger); traceOutput.setQuote(quote); // should be US-ASCII, but not all JDK's support it so use iso-8859-1 input = new BufferedReader(new InputStreamReader(traceInput, "iso-8859-1")); output = new PrintWriter( new BufferedWriter( new OutputStreamWriter(traceOutput, "iso-8859-1"))); }
/** * Constructor for debugging. */ public Protocol(InputStream in, OutputStream out, boolean debug) throws IOException { this.host = "localhost"; this.debug = debug; this.quote = false; this.out = System.out; // XXX - inlined initStreams, won't allow later startTLS traceInput = new TraceInputStream(in, System.out); traceInput.setTrace(debug); traceInput.setQuote(quote); input = new ResponseInputStream(traceInput); traceOutput = new TraceOutputStream(out, System.out); traceOutput.setTrace(debug); traceOutput.setQuote(quote); output = new DataOutputStream(new BufferedOutputStream(traceOutput)); timestamp = System.currentTimeMillis(); }
/** * Temporarily turn off protocol tracing, e.g., to prevent * tracing the authentication sequence, including the password. */ protected void suspendTracing() { if (traceLogger.isLoggable(Level.FINEST)) { traceInput.setTrace(false); traceOutput.setTrace(false); } }
/** * Writes <code>b.length</code> bytes to this output stream. * Writes out the bytes into the trace stream if the trace * mode is <code>true</code> * * @param b bytes to write * @param off offset in array * @param len number of bytes to write * @exception IOException for I/O errors */ public void write(byte b[], int off, int len) throws IOException { if (trace) { if (quote) { for (int i = 0; i < len; i++) writeByte(b[off + i]); } else traceOut.write(b, off, len); } out.write(b, off, len); }
private void initStreams() throws IOException { boolean quote = PropUtil.getBooleanProperty(props, "mail.debug.quote", false); traceInput = new TraceInputStream(socket.getInputStream(), traceLogger); traceInput.setQuote(quote); traceOutput = new TraceOutputStream(socket.getOutputStream(), traceLogger); traceOutput.setQuote(quote); // should be US-ASCII, but not all JDK's support it so use iso-8859-1 input = new BufferedReader(new InputStreamReader(traceInput, "iso-8859-1")); output = new PrintWriter( new BufferedWriter( new OutputStreamWriter(traceOutput, "iso-8859-1"))); }
private void initStreams() throws IOException { PrintStream out = session.getDebugOut(); boolean quote = PropUtil.getBooleanSessionProperty(session, "mail.debug.quote", false); traceInput = new TraceInputStream(serverSocket.getInputStream(), out); traceInput.setTrace(debug); traceInput.setQuote(quote); traceOutput = new TraceOutputStream(serverSocket.getOutputStream(), out); traceOutput.setTrace(debug); traceOutput.setQuote(quote); serverOutput = new BufferedOutputStream(traceOutput); serverInput = new BufferedInputStream(traceInput); lineInputStream = new LineInputStream(serverInput); }
/** * Temporarily turn off protocol tracing, e.g., to prevent * tracing the authentication sequence, including the password. */ private void suspendTracing() { if (traceLogger.isLoggable(Level.FINEST)) { traceInput.setTrace(false); traceOutput.setTrace(false); } }
/** * Writes <code>b.length</code> bytes to this output stream. * Writes out the bytes into the trace stream if the trace * mode is <code>true</code> * * @param b bytes to write * @param off offset in array * @param len number of bytes to write * @exception IOException for I/O errors */ @Override public void write(byte b[], int off, int len) throws IOException { if (trace) { if (quote) { for (int i = 0; i < len; i++) writeByte(b[off + i]); } else traceOut.write(b, off, len); } out.write(b, off, len); }
private void initStreams() throws IOException { boolean quote = PropUtil.getBooleanSessionProperty(session, "mail.debug.quote", false); traceInput = new TraceInputStream(serverSocket.getInputStream(), traceLogger); traceInput.setQuote(quote); traceOutput = new TraceOutputStream(serverSocket.getOutputStream(), traceLogger); traceOutput.setQuote(quote); serverOutput = new BufferedOutputStream(traceOutput); serverInput = new BufferedInputStream(traceInput); lineInputStream = new LineInputStream(serverInput); }
private void initStreams() throws IOException { Properties props = session.getProperties(); PrintStream out = session.getDebugOut(); boolean debug = session.getDebug(); String s = props.getProperty("mail.debug.quote"); boolean quote = s != null && s.equalsIgnoreCase("true"); TraceInputStream traceInput = new TraceInputStream(serverSocket.getInputStream(), out); traceInput.setTrace(debug); traceInput.setQuote(quote); TraceOutputStream traceOutput = new TraceOutputStream(serverSocket.getOutputStream(), out); traceOutput.setTrace(debug); traceOutput.setQuote(quote); serverOutput = new BufferedOutputStream(traceOutput); serverInput = new BufferedInputStream(traceInput); lineInputStream = new LineInputStream(serverInput); }
/** * Temporarily turn off protocol tracing, e.g., to prevent * tracing the authentication sequence, including the password. */ protected void suspendTracing() { if (traceLogger.isLoggable(Level.FINEST)) { traceInput.setTrace(false); traceOutput.setTrace(false); } }