protected BuildProcess getDeployerProcess()

in deploy-runner-agent/src/main/java/jetbrains/buildServer/deployer/agent/ftp/FtpDeployerRunner.java [26:42]


  protected BuildProcess getDeployerProcess(@NotNull final BuildRunnerContext context,
                                            @NotNull final String username,
                                            @NotNull final String password,
                                            @NotNull final String target,
                                            @NotNull final List<ArtifactsCollection> artifactsCollections) throws RunBuildException {
    final Map<String, String> runnerParameters = context.getRunnerParameters();
    final String authMethod = runnerParameters.get(FTPRunnerConstants.PARAM_AUTH_METHOD);

    if (FTPRunnerConstants.AUTH_METHOD_USER_PWD.equals(authMethod)) {
      return new FtpBuildProcessAdapter(context, target, username, password, artifactsCollections);
    } else if (FTPRunnerConstants.AUTH_METHOD_ANONYMOUS.equals(authMethod)) {
      return new FtpBuildProcessAdapter(context, target, "anonymous", " ", artifactsCollections);
    } else {
      throw new RunBuildException("Unknown FTP authentication method: [" + authMethod + "]");
    }

  }