Class LPVSGitHubConnectionService

java.lang.Object
com.lpvs.service.LPVSGitHubConnectionService

@Service public class LPVSGitHubConnectionService extends Object
Service class for managing connections to the GitHub API. It provides methods to connect to the GitHub API with the specified login and authentication token.
  • Constructor Details

    • LPVSGitHubConnectionService

      @Autowired public LPVSGitHubConnectionService(@Value("${github.login}") String GITHUB_LOGIN, @Value("${github.token}") String GITHUB_AUTH_TOKEN, @Value("${github.api.url}") String GITHUB_API_URL, LPVSExitHandler exitHandler)
      Constructs an instance of LPVSGitHubConnectionService with the specified properties and exit handler.
      Parameters:
      GITHUB_LOGIN - GitHub login username.
      GITHUB_AUTH_TOKEN - GitHub authentication token.
      GITHUB_API_URL - GitHub API URL for connecting to a GitHub Enterprise instance.
      exitHandler - Handler for exiting the application.
  • Method Details

    • connectToGitHubApi

      public org.kohsuke.github.GitHub connectToGitHubApi() throws IOException
      Connects to the GitHub API based on the configured login, authentication token, and API URL.
      Returns:
      GitHub instance for interacting with the GitHub API.
      Throws:
      IOException - if an error occurs during the GitHub connection.
    • setGithubTokenFromEnv

      public void setGithubTokenFromEnv()
      Sets the GitHub authentication token from the environment variable if available.