protected BuildProcess getDeployerProcess()

in deploy-runner-agent/src/main/java/jetbrains/buildServer/deployer/agent/smb/SmbDeployerRunner.java [39:73]


  protected BuildProcess getDeployerProcess(@NotNull final BuildRunnerContext context,
                                            @NotNull final String username,
                                            @NotNull final String password,
                                            @NotNull final String target,
                                            @NotNull final List<ArtifactsCollection> artifactsCollections) {

    try {
      final String domain;
      final String actualUsername;

      if (username.indexOf('\\') > -1) {
        domain = username.substring(0, username.indexOf('\\'));
        actualUsername = username.substring(username.indexOf('\\') + 1);
      } else {
        domain = "";
        actualUsername = username;
      }

      if (shouldEnforceSMBv1(context)) {
        context.getBuild().getBuildLogger().warning("Enforced deprecated SMB v1 usage");
        return getSmbV1Process(context, actualUsername, password, domain, target, artifactsCollections);
      }

      if (SystemInfo.isJavaVersionAtLeast("1.7.0")) {
          context.getBuild().getBuildLogger().message("Using SMB v2/v3 protocol");
          return getSmbV2Process(context, actualUsername, password, domain, target,artifactsCollections);
      } else {
        context.getBuild().getBuildLogger().warning("Falling back to deprecated SMB v1. Update jvm to 1.7+ to use SMB v2");
        return getSmbV1Process(context, actualUsername, password, domain, target, artifactsCollections);
      }

    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }