I'm currently working on a Java Spring project and I need to retrieve all the .txt files from a specific folder in a GitHub repository using the JGit library. I have been exploring the JGit documentation, but I'm having trouble figuring out the exact steps to achieve this.
My goal is to integrate this functionality into my Spring application, where I can specify the private GitHub repository URL and the target folder within that repository. The application should then use JGit to connect to the repository using PAT or anything else, navigate to the folder, and fetch all the .txt files present there.
Could someone please provide me with a code example or guide me through the necessary steps to accomplish this? Any insights, tips, or code snippets would be greatly appreciated.
In my Spring application, I've started by adding the JGit library as a dependency and exploring its documentation to understand its functionality. I've managed to establish a connection to the GitHub repository using JGit, but I'm unsure about the exact sequence of steps required to navigate to a specific folder within the repository and retrieve all the .txt
files from that folder.
I was expecting to find more specific examples or tutorials related to using JGit with Spring to achieve this task. However, I haven't been able to find a comprehensive guide that covers fetching files from a specific folder in a GitHub repository using JGit within a Spring application context.