try {
if (log.isDebugEnabled()) {
log.info("Waiting for response");
}
SubsystemMessage reply = messageStore.getMessage(requestId);
log.info("Received response");
if (reply instanceof SshFxpStatus) {
SshFxpStatus status = (SshFxpStatus) reply;
if (status.getErrorCode().intValue() != SshFxpStatus.STATUS_FX_OK) {
throw new IOException(((SshFxpStatus) reply).getErrorMessage());
}
} else {
throw new IOException("Unexpected server response " +
reply.getMessageName());
}
} catch (InterruptedException ex) {
throw new IOException("The thread was interrupted");
}
}