in deploy-runner-agent/src/main/java/jetbrains/buildServer/deployer/agent/ssh/sftp/SftpBuildProcessAdapter.java [97:112]
private void createRemotePath(@NotNull final ChannelSftp channel,
@NotNull final String destination) throws SftpException {
final int endIndex = destination.lastIndexOf('/');
if (endIndex > 0) {
createRemotePath(channel, destination.substring(0, endIndex));
}
try {
channel.stat(destination);
} catch (SftpException e) {
// dir does not exist.
if (e.id == ChannelSftp.SSH_FX_NO_SUCH_FILE) {
channel.mkdir(destination);
}
}
}