package com.jscape.inet.ftps;

import com.jscape.inet.ftp.ClientProtocolInterpreter;
import com.jscape.inet.ftp.FtpException;
import com.jscape.util.Assert;

/**
 * @author Alex
 * @version 1.0
 * @see <a href="FtpsProtocolInterpreter.java.html">Source code</a>
 */
final class FtpsProtocolInterpreter
        implements ClientProtocolInterpreter {

    private FtpsClient client;

    /**
     * Creates a new interpreter instance.
     *
     * @param client client
     */
    FtpsProtocolInterpreter(FtpsClient client) {
        Assert.notNull(client);
        this.client = client;
    }

    /**
     * @see ClientProtocolInterpreter#sendCommand(String)
     */
    public void sendCommand(String command)
            throws FtpException {
        this.client.sendCommand(command);
    }

    /**
     * @see com.jscape.inet.ftp.ClientProtocolInterpreter#receiveReply()
     */
    public String receiveReply()
            throws FtpException {
        return this.client.readResponse().toString();
    }

}
