if (getSecureFXPType() == Command.CPSV) {  Command protCommand = new Command(Command.PROT, "P"); Reply protReply = destination.sendCommand(protCommand); protReply.dumpReply(); protReply.validate();   Reply srcProtReply = sendCommand(protCommand); srcProtReply.dumpReply(); srcProtReply.validate(); }
    public void fxpFile(FTPConnection destination, FTPFile fromFile,            FTPFile toFile) throws IOException, FtpWorkflowException,            FtpIOException {                setConnectionStatusLock(CSL_INDIRECT_CALL);        setConnectionStatus(FXPING_FILE_STARTED, fromFile, toFile);        setConnectionStatus(FXP_FILE);        Command pasvCommand = null;        if (getSecureFXPType() == Command.SSCN && !sscnActive) {            setSSCNFxp(true);            sscnActive = true;            pasvCommand = new Command(Command.PASV);        }        else if(getSecureFXPType() == Command.CPSV)        {        	pasvCommand = new Command(Command.CPSV);        }        // send PASV to source site        Reply pasvReply = sendCommand(pasvCommand);        pasvReply.dumpReply();        pasvReply.validate();        // parse the host and port from reply        List<String> lines = pasvReply.getLines();        if (lines.size() != 1)            throw new UnkownReplyStateException(                    "PASV Reply has to have a size of 1 entry but it has: "                            + lines.size());        String line = lines.get(0);        line = line.substring(line.indexOf('(') + 1, line.lastIndexOf(')'));        // send PORT to destination site        Command portCommand = new Command(Command.PORT, line);        Reply portReply = destination.sendCommand(portCommand);        portReply.dumpReply();        portReply.validate();        // send STOR command to destination site        Command storeCommand = new Command(Command.STOR, toFile.toString());        Reply storeReply = destination.sendCommand(storeCommand);        storeReply.dumpReply();        storeReply.validate();        // send RETR command to source site        Command retrCommand = new Command(Command.RETR, fromFile.toString());        Reply retrReply = sendCommand(retrCommand);        retrReply.dumpReply();        retrReply.validate();        // read the last control reply from source        if (retrReply.getLines().size() == 1) {        	try {        		(ReplyWorker.readReply(socketProvider)).dumpReply();            }catch(IOException ioe) {                setConnectionStatus(ERROR);                disconnect();            	throw ioe;            }        }                // read the last control reply from destination        if (storeReply.getLines().size() == 1) {            try {                (ReplyWorker.readReply(destination.socketProvider)).dumpReply();            }catch(IOException ioe) {                destination.setConnectionStatus(ERROR);                destination.disconnect();                throw ioe;            }        }        if (getSecureFXPType() == Command.SSCN && sscnActive) {            setSSCNFxp(false);            sscnActive = false;        }        setConnectionStatus(FXPING_FILE_ENDED, fromFile, toFile);        setConnectionStatus(IDLE);        setConnectionStatusLock(CSL_DIRECT_CALL);    }