FTPTransferType currentTransferType = chooseTransferMode(remoteFile);
String result = null;
try {
ByteArrayInputStream input = null;
if (retryCount == 0 || append) {
input = new ByteArrayInputStream(bytes);
result = putStream(input, remoteFile, append);
} else {
for (int attempt = 1;; attempt++) {
try {
if (attempt > 1
&& getType().equals(FTPTransferType.BINARY))
resume();
log.debug("Attempt #" + attempt);
input = new ByteArrayInputStream(bytes);
result = putStream(input, remoteFile, append);
break;
} catch (ControlChannelIOException ex) {
if (!processControlChannelException(cwd, ex, attempt))
throw ex;