Examples of InternetPrintWriter


Examples of org.apache.james.util.InternetPrintWriter

     * @param headerOs
     * @param ignoreList
     * @throws MessagingException
     */
    public static void writeHeadersTo(Enumeration headers, OutputStream headerOs) throws MessagingException {
        PrintWriter hos = new InternetPrintWriter(new BufferedWriter(new OutputStreamWriter(headerOs), 512), true);
        while (headers.hasMoreElements()) {
            hos.println((String)headers.nextElement());
        }
        // Print header/data separator
        hos.println();
        hos.flush();
    }
View Full Code Here

Examples of org.apache.james.util.InternetPrintWriter

            getLogger().info(infoBuffer.toString());
        }

        try {

            out = new InternetPrintWriter(new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()), 1024), false);

            // Initially greet the connector
            // Format is:  Sat, 24 Jan 1998 13:16:09 -0500

            responseBuffer.append("220 ")
View Full Code Here

Examples of org.apache.james.util.InternetPrintWriter

            getLogger().info(logBuffer.toString());
        }

        try {
            outs = new BufferedOutputStream(socket.getOutputStream(), 1024);
            out = new InternetPrintWriter(outs, true);
            state = AUTHENTICATION_READY;
            user = "unknown";
            StringBuffer responseBuffer =
                new StringBuffer(256)
                        .append(OK_RESPONSE)
View Full Code Here

Examples of org.apache.james.util.InternetPrintWriter

            // An ASCII encoding can be used because all transmissions other
            // that those in the message body command are guaranteed
            // to be ASCII
            reader = new BufferedReader(new InputStreamReader(in, "ASCII"), 512);
            outs = new BufferedOutputStream(socket.getOutputStream(), 1024);
            writer = new InternetPrintWriter(outs, true);
        } catch (Exception e) {
            StringBuffer exceptionBuffer =
                new StringBuffer(256)
                    .append("Cannot open connection from ")
                    .append(remoteHost)
View Full Code Here

Examples of org.apache.james.util.InternetPrintWriter

            // An ASCII encoding can be used because all transmissions other
            // that those in the message body command are guaranteed
            // to be ASCII
            reader = new BufferedReader(new InputStreamReader(in, "ASCII"), 512);
            outs = new BufferedOutputStream(socket.getOutputStream(), 1024);
            writer = new InternetPrintWriter(outs, true);
        } catch (Exception e) {
            StringBuffer exceptionBuffer =
                new StringBuffer(256)
                    .append("Cannot open connection from ")
                    .append(remoteHost)
View Full Code Here

Examples of org.apache.james.util.InternetPrintWriter

            getLogger().info(infoBuffer.toString());
        }

        try {

            out = new InternetPrintWriter(new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()), 1024), false);

            // Initially greet the connector
            // Format is:  Sat, 24 Jan 1998 13:16:09 -0500

            responseBuffer.append("220 ")
View Full Code Here

Examples of org.apache.james.util.InternetPrintWriter

            getLogger().info(logBuffer.toString());
        }

        try {
            outs = new BufferedOutputStream(socket.getOutputStream(), 1024);
            out = new InternetPrintWriter(outs, true);
            state = AUTHENTICATION_READY;
            user = "unknown";
            StringBuffer responseBuffer =
                new StringBuffer(256)
                        .append(OK_RESPONSE)
View Full Code Here

Examples of org.apache.james.util.InternetPrintWriter

     * @param headerOs
     * @param ignoreList
     * @throws MessagingException
     */
    public static void writeHeadersTo(Enumeration headers, OutputStream headerOs) throws MessagingException {
        PrintWriter hos = new InternetPrintWriter(new BufferedWriter(new OutputStreamWriter(headerOs), 512), true);
        while (headers.hasMoreElements()) {
            hos.println((String)headers.nextElement());
        }
        // Print header/data separator
        hos.println();
        hos.flush();
    }
View Full Code Here

Examples of org.apache.james.util.InternetPrintWriter

            //First handle the headers
            InputStream in = source.getInputStream();
            try {
                InternetHeaders headers = new InternetHeaders(in);
                PrintWriter pos = new InternetPrintWriter(new BufferedWriter(new OutputStreamWriter(headerOs), 512), true);
                for (Enumeration e = headers.getNonMatchingHeaderLines(ignoreList); e.hasMoreElements(); ) {
                    String header = (String)e.nextElement();
                    pos.println(header);
                }
                pos.println();
                pos.flush();
                MimeMessageUtil.copyStream(in, bodyOs);
            } finally {
                IOUtil.shutdownStream(in);
            }
        } else {
View Full Code Here

Examples of org.apache.james.util.InternetPrintWriter

        try {
            this.socket = connection;
            in = new BufferedReader(new
                InputStreamReader(socket.getInputStream()));
            outs = socket.getOutputStream();
            out = new InternetPrintWriter(outs, true);
            remoteHost = socket.getInetAddress ().getHostName ();
            remoteIP = socket.getInetAddress ().getHostAddress ();
        } catch (Exception e) {
            getLogger().error("Cannot open connection from " + remoteHost + " ("
                              + remoteIP + "): " + e.getMessage());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.