Example usage for org.apache.commons.net SocketClient NETASCII_EOL

List of usage examples for org.apache.commons.net SocketClient NETASCII_EOL

Introduction

In this page you can find the example usage for org.apache.commons.net SocketClient NETASCII_EOL.

Prototype

String NETASCII_EOL

To view the source code for org.apache.commons.net SocketClient NETASCII_EOL.

Click Source Link

Document

The end of line character sequence used by most IETF protocols.

Usage

From source file:net.sf.ufsc.ftp.FTPSClient.java

@SuppressWarnings("nls")
public void secure() throws IOException {
    int reply = this.sendCommand("AUTH", PROTOCOL);

    if (!FTPReply.isPositiveCompletion(reply)) {
        throw new IOException(this.getReplyString());
    }//from  w  w  w .  ja  v  a 2 s  .c  o  m

    this.logReply();

    this.setSocketFactory(this.socketFactory);

    this.clearSocket = this._socket_;
    this._socket_ = this.socketFactory.secureSocket(this._socket_, this._socket_.getInetAddress().getHostName(),
            this._socket_.getPort(), true);

    OutputStream output = this._socket_.getOutputStream();
    output.write(("PBSZ 0" + SocketClient.NETASCII_EOL).getBytes());
    output.flush();

    this._connectAction_();

    reply = this.sendCommand("PROT", "P");

    if (!FTPReply.isPositiveCompletion(reply)) {
        throw new IOException(this.getReplyString());
    }
}

From source file:com.myJava.file.driver.remote.ftp.SecuredSocketFactory.java

private void sendCommand(String command, Socket socket, boolean readReply) throws IOException {
    Logger.defaultLogger().info("Sending FTP command : " + command);

    // Send Command
    BufferedWriter out = new BufferedWriter(
            new OutputStreamWriter(socket.getOutputStream(), client.getControlEncoding()));
    out.write(command + SocketClient.NETASCII_EOL);
    out.flush();//from   ww  w  .  ja  v a 2  s.  co  m

    if (readReply) {
        readReply(socket);
    }
}

From source file:uk.ac.manchester.cs.datadesc.validator.rdftools.FtpListener.java

private void logPrintableString(String msg) {
    msg = msg.trim();/*from  w ww .  ja va2s.c om*/
    int pos = msg.indexOf(SocketClient.NETASCII_EOL);
    if (pos > 0) {
        logger.debug(msg.substring(0, pos));
        String part2 = msg.substring(pos).trim();
        if (!part2.isEmpty()) {
            logger.debug(part2);
        }
    } else {
        if (!msg.isEmpty()) {
            logger.debug(msg);
        }
    }
}