package jetbrains.buildServer.deployer.agent.ssh;

import com.jcraft.jsch.JSchException;
import jetbrains.buildServer.RunBuildException;
import jetbrains.buildServer.agent.*;
import jetbrains.buildServer.deployer.common.DeployerRunnerConstants;
import jetbrains.buildServer.deployer.common.SSHRunnerConstants;
import jetbrains.buildServer.util.StringUtil;
import org.jetbrains.annotations.NotNull;

import java.io.File;

public class SSHExecRunner implements AgentBuildRunner {

    @NotNull
    @Override
    public BuildProcess createBuildProcess(@NotNull AgentRunningBuild runningBuild, @NotNull final BuildRunnerContext context) throws RunBuildException {

        final SSHSessionProvider provider;
        try {
            provider = new SSHSessionProvider(context).invoke();
        } catch (JSchException e) {
            throw new RunBuildException(e);
        }

        final String command = context.getRunnerParameters().get(SSHRunnerConstants.PARAM_COMMAND);
        return new SSHExecProcessAdapter(provider, command, runningBuild.getBuildLogger());
    }

    @NotNull
    @Override
    public AgentBuildRunnerInfo getRunnerInfo() {
        return new SSHExecRunnerInfo();
    }


}

@@ -172,78 +172,8 @@
 .*;%0A
-import jetbrains.buildServer.deployer.common.DeployerRunnerConstants;%0A
 impo
@@ -326,30 +326,8 @@
 l;%0A%0A
-import java.io.File;%0A%0A
 publ
@@ -806,16 +806,38 @@
 mmand = 
+StringUtil.notNullize(
 context.
@@ -895,16 +895,17 @@
 COMMAND)
+)
 ;%0A      

fix http://youtrack.jetbrains.com/issue/TW-28631 replace null with empty string